Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b3d07ff

Browse files
authored
fix: Test race for TestPostWorkspaceBuild (#4102)
1 parent 63fd494 commit b3d07ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

coderd/workspaces_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ func TestPostWorkspaceBuild(t *testing.T) {
830830

831831
t.Run("WithState", func(t *testing.T) {
832832
t.Parallel()
833-
client := coderdtest.New(t, &coderdtest.Options{
833+
client, closeDaemon := coderdtest.NewWithProvisionerCloser(t, &coderdtest.Options{
834834
IncludeProvisionerDaemon: true,
835835
})
836836
user := coderdtest.CreateFirstUser(t, client)
@@ -840,6 +840,7 @@ func TestPostWorkspaceBuild(t *testing.T) {
840840
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
841841
coderdtest.AwaitWorkspaceBuildJob(t, client, workspace.LatestBuild.ID)
842842
wantState := []byte("something")
843+
_ = closeDaemon.Close()
843844

844845
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
845846
defer cancel()

0 commit comments

Comments
 (0)