Skip to content

Commit 8af25dc

Browse files
committed
fix: iterate through all workspace updates on logs overflow
This was causing some flakes!
1 parent 6378294 commit 8af25dc

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

coderd/workspaceagents_test.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,19 @@ func TestWorkspaceAgentStartupLogs(t *testing.T) {
282282
require.ErrorAs(t, err, &apiError)
283283
require.Equal(t, http.StatusRequestEntityTooLarge, apiError.StatusCode())
284284

285-
var update codersdk.Workspace
286-
select {
287-
case <-ctx.Done():
288-
t.FailNow()
289-
case update = <-updates:
285+
// It's possible we have multiple updates queued, but that's alright, we just
286+
// wait for the one where it overflows.
287+
for {
288+
var update codersdk.Workspace
289+
select {
290+
case <-ctx.Done():
291+
t.FailNow()
292+
case update = <-updates:
293+
}
294+
if update.LatestBuild.Resources[0].Agents[0].StartupLogsOverflowed {
295+
break
296+
}
290297
}
291-
// Ensure that the UI gets an update when the logs overflow!
292-
require.True(t, update.LatestBuild.Resources[0].Agents[0].StartupLogsOverflowed)
293298
})
294299
}
295300

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy