-
Notifications
You must be signed in to change notification settings - Fork 887
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
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()) | ||
}) | ||
t.Run("Success", func(t *testing.T) { | ||
// 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) | ||
require.NoError(t, err) | ||
return version.Job.Status == codersdk.ProvisionerJobCanceled | ||
return assert.NoError(t, err) && | ||
// 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) | ||
}) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, TIL these could be used as booleans.