chore: update testutil chan helpers (#17408)

This commit is contained in:
ケイラ
2025-04-16 09:37:09 -07:00
committed by GitHub
parent 2a76f5028e
commit f670bc31f5
45 changed files with 582 additions and 559 deletions

View File

@ -400,7 +400,7 @@ func TestExecutorAutostartUserSuspended(t *testing.T) {
}()
// Then: nothing should happen
stats := testutil.RequireRecvCtx(ctx, t, statsCh)
stats := testutil.TryReceive(ctx, t, statsCh)
assert.Len(t, stats.Errors, 0)
assert.Len(t, stats.Transitions, 0)
}
@ -1167,7 +1167,7 @@ func TestNotifications(t *testing.T) {
// Wait for workspace to become dormant
notifyEnq.Clear()
ticker <- workspace.LastUsedAt.Add(timeTilDormant * 3)
_ = testutil.RequireRecvCtx(testutil.Context(t, testutil.WaitShort), t, statCh)
_ = testutil.TryReceive(testutil.Context(t, testutil.WaitShort), t, statCh)
// Check that the workspace is dormant
workspace = coderdtest.MustWorkspace(t, client, workspace.ID)