Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
instead of sleep use eventually
  • Loading branch information
kacpersaw committed Aug 27, 2025
commit 78eecfbb832cdc2fdbffedc53dcab8367d7a33b1
7 changes: 4 additions & 3 deletions coderd/workspacebuilds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,11 @@ func TestPatchCancelWorkspaceBuild(t *testing.T) {
return assert.NoError(t, err) && build.Job.Status == codersdk.ProvisionerJobRunning
}, testutil.WaitShort, testutil.IntervalFast)

time.Sleep(testutil.IntervalMedium)
require.Eventually(t, func() bool {
err := client.CancelWorkspaceBuild(ctx, build.ID, codersdk.CancelWorkspaceBuildParams{})
return assert.NoError(t, err)
}, testutil.WaitShort, testutil.IntervalMedium)

err := client.CancelWorkspaceBuild(ctx, build.ID, codersdk.CancelWorkspaceBuildParams{})
require.NoError(t, err)
require.Eventually(t, func() bool {
var err error
build, err = client.WorkspaceBuild(ctx, build.ID)
Expand Down