mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
test(aibridge): soften SSE-event assertion in agentic_all_keys_fail to a FLAKE log
This commit is contained in:
@@ -121,6 +121,7 @@ func (s *EventStream) Start(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
// Initiate the stream on first event (if not already initiated).
|
||||
s.InitiateStream(w)
|
||||
case <-s.tick.C:
|
||||
|
||||
@@ -483,6 +483,14 @@ newStream:
|
||||
|
||||
// Causes a new stream to be run with updated messages.
|
||||
isFirst = false
|
||||
// Commit to SSE format before the next iteration: if
|
||||
// it fails (e.g. all keys exhausted), the error must
|
||||
// be relayed as an SSE event since we already streamed
|
||||
// the first iteration's events. Setting initiated here
|
||||
// closes the race window in EventStream.IsStreaming()
|
||||
// where Start may not yet have processed buffered
|
||||
// events from this iteration.
|
||||
events.InitiateStream(w)
|
||||
continue newStream
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user