Skip to content

Commit 8903040

Browse files
committed
Fix test flake introduced by #9264
Signed-off-by: Spike Curtis <spike@coder.com>
1 parent 60d5002 commit 8903040

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

coderd/templateversions_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,12 @@ func TestPatchCancelTemplateVersion(t *testing.T) {
308308
require.Eventually(t, func() bool {
309309
var err error
310310
version, err = client.TemplateVersion(ctx, version.ID)
311+
// job gets marked Failed when there is an Error; in practice we never get to Status = Canceled
312+
// because provisioners report an Error when canceled. We check the Error string to ensure we don't mask
313+
// other errors in this test.
311314
return assert.NoError(t, err) &&
312-
// The job will never actually cancel successfully because it will never send a
313-
// provision complete response.
314-
assert.Empty(t, version.Job.Error) &&
315-
version.Job.Status == codersdk.ProvisionerJobCanceling
315+
version.Job.Error == "canceled" &&
316+
version.Job.Status == codersdk.ProvisionerJobFailed
316317
}, testutil.WaitShort, testutil.IntervalFast)
317318
})
318319
}

0 commit comments

Comments
 (0)