mirror of
https://github.com/coder/coder.git
synced 2025-07-18 14:17:22 +00:00
fix: coderdtest: increase ForceCancelInterval (#3085)
Two coderd unit tests (TestPatchCancelTemplateVersion/Success and TestPatchCancelWorkspaceBuild) implied erroneously that the job was canceled successfully. This is not the case, as these unit tests do not include a Provision_Complete response in the input to the echo provisioner. Now explicitly checking the job error and bumping the force cancel interval to be longer. Fixes #3083.
This commit is contained in:
@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/coder/coder/coderd/coderdtest"
|
||||
@ -228,8 +229,11 @@ func TestPatchCancelWorkspaceBuild(t *testing.T) {
|
||||
require.Eventually(t, func() bool {
|
||||
var err error
|
||||
build, err = client.WorkspaceBuild(context.Background(), build.ID)
|
||||
require.NoError(t, err)
|
||||
return build.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, build.Job.Error) &&
|
||||
build.Job.Status == codersdk.ProvisionerJobCanceling
|
||||
}, 5*time.Second, 25*time.Millisecond)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user