mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
fix: iterate through all workspace updates on logs overflow (#6885)
This was causing some flakes!
This commit is contained in:
@ -282,14 +282,19 @@ func TestWorkspaceAgentStartupLogs(t *testing.T) {
|
|||||||
require.ErrorAs(t, err, &apiError)
|
require.ErrorAs(t, err, &apiError)
|
||||||
require.Equal(t, http.StatusRequestEntityTooLarge, apiError.StatusCode())
|
require.Equal(t, http.StatusRequestEntityTooLarge, apiError.StatusCode())
|
||||||
|
|
||||||
var update codersdk.Workspace
|
// It's possible we have multiple updates queued, but that's alright, we just
|
||||||
select {
|
// wait for the one where it overflows.
|
||||||
case <-ctx.Done():
|
for {
|
||||||
t.FailNow()
|
var update codersdk.Workspace
|
||||||
case update = <-updates:
|
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)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user