mirror of https://github.com/coder/coder.git
fix: iterate through all workspace updates on logs overflow (#6885)
This was causing some flakes!
This commit is contained in:
parent
e470162305
commit
5c1dc1b7fe
|
@ -282,14 +282,19 @@ func TestWorkspaceAgentStartupLogs(t *testing.T) {
|
|||
require.ErrorAs(t, err, &apiError)
|
||||
require.Equal(t, http.StatusRequestEntityTooLarge, apiError.StatusCode())
|
||||
|
||||
var update codersdk.Workspace
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
t.FailNow()
|
||||
case update = <-updates:
|
||||
// It's possible we have multiple updates queued, but that's alright, we just
|
||||
// wait for the one where it overflows.
|
||||
for {
|
||||
var update codersdk.Workspace
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
t.FailNow()
|
||||
case update = <-updates:
|
||||
}
|
||||
if update.LatestBuild.Resources[0].Agents[0].StartupLogsOverflowed {
|
||||
break
|
||||
}
|
||||
}
|
||||
// Ensure that the UI gets an update when the logs overflow!
|
||||
require.True(t, update.LatestBuild.Resources[0].Agents[0].StartupLogsOverflowed)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue