mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
test(cli): remove IncludeProvisionerDaemon from task snapshot tests (#21850)
These tests use dbfake to set up database state directly and don't need a provisioner daemon. Removing it fixes a flaky failure on Windows where the provisioner daemon acquired a job that dbfake had already "completed", causing the task status to be "error" instead of "paused". Fixes coder/internal#1322 Refs coder/internal#1323
This commit is contained in:
committed by
GitHub
parent
90aeea5649
commit
f1dae81fd5
+8
-2
@@ -276,10 +276,13 @@ func setupCLITaskTest(ctx context.Context, t *testing.T, agentAPIHandlers map[st
|
||||
}
|
||||
|
||||
// setupCLITaskTestWithSnapshot creates a task in the specified status with a log snapshot.
|
||||
// Note: We do not use IncludeProvisionerDaemon because these tests use dbfake to directly
|
||||
// set up database state and don't need actual provisioning. This also avoids potential
|
||||
// interference from the provisioner daemon polling for jobs.
|
||||
func setupCLITaskTestWithSnapshot(ctx context.Context, t *testing.T, status codersdk.TaskStatus, messages []agentapisdk.Message) (*codersdk.Client, codersdk.Task) {
|
||||
t.Helper()
|
||||
|
||||
ownerClient, db := coderdtest.NewWithDatabase(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
|
||||
ownerClient, db := coderdtest.NewWithDatabase(t, nil)
|
||||
owner := coderdtest.CreateFirstUser(t, ownerClient)
|
||||
userClient, user := coderdtest.CreateAnotherUser(t, ownerClient, owner.OrganizationID)
|
||||
|
||||
@@ -312,10 +315,13 @@ func setupCLITaskTestWithSnapshot(ctx context.Context, t *testing.T, status code
|
||||
}
|
||||
|
||||
// setupCLITaskTestWithoutSnapshot creates a task in the specified status without a log snapshot.
|
||||
// Note: We do not use IncludeProvisionerDaemon because these tests use dbfake to directly
|
||||
// set up database state and don't need actual provisioning. This also avoids potential
|
||||
// interference from the provisioner daemon polling for jobs.
|
||||
func setupCLITaskTestWithoutSnapshot(t *testing.T, status codersdk.TaskStatus) (*codersdk.Client, codersdk.Task) {
|
||||
t.Helper()
|
||||
|
||||
ownerClient, db := coderdtest.NewWithDatabase(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
|
||||
ownerClient, db := coderdtest.NewWithDatabase(t, nil)
|
||||
owner := coderdtest.CreateFirstUser(t, ownerClient)
|
||||
userClient, user := coderdtest.CreateAnotherUser(t, ownerClient, owner.OrganizationID)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user