- Notifications
You must be signed in to change notification settings - Fork928
fix: coderdtest: increase ForceCancelInterval#3085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -126,7 +126,9 @@ func TestPatchCancelTemplateVersion(t *testing.T) { | ||
require.ErrorAs(t, err, &apiErr) | ||
require.Equal(t, http.StatusPreconditionFailed, apiErr.StatusCode()) | ||
}) | ||
// TODO(Cian): until we are able to test cancellation properly, validating | ||
// Running -> Canceling is the best we can do for now. | ||
t.Run("Canceling", func(t *testing.T) { | ||
t.Parallel() | ||
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerD: true}) | ||
user := coderdtest.CreateFirstUser(t, client) | ||
@@ -150,8 +152,11 @@ func TestPatchCancelTemplateVersion(t *testing.T) { | ||
require.Eventually(t, func() bool { | ||
var err error | ||
version, err = client.TemplateVersion(context.Background(), version.ID) | ||
return assert.NoError(t, err) && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Oh nice, TIL these could be used as booleans. | ||
// The job will never actually cancel successfully because it will never send a | ||
// provision complete response. | ||
assert.Empty(t, version.Job.Error) && | ||
version.Job.Status == codersdk.ProvisionerJobCanceling | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This is fine with me as a workaround for now, but it exposes that we don't have any tests that actually reach One thing that's probably worth doing is renaming this testcase Success -> Canceling to reflect the fact that we don't have a Success testcase yet. | ||
}, 5*time.Second, 25*time.Millisecond) | ||
}) | ||
} | ||