Skip to content

Commit dcad0a4

Browse files
authored
fix: wait for build job (#9680)
1 parent 8b6e286 commit dcad0a4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coderd/workspaces_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,8 @@ func TestPostWorkspacesByOrganization(t *testing.T) {
586586
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID, func(cwr *codersdk.CreateWorkspaceRequest) {
587587
cwr.TTLMillis = ptr.Ref(int64(0))
588588
})
589+
coderdtest.AwaitWorkspaceBuildJob(t, client, workspace.LatestBuild.ID)
590+
589591
// Then: No TTL should be set by the template
590592
require.Nil(t, workspace.TTLMillis)
591593
})
@@ -603,6 +605,8 @@ func TestPostWorkspacesByOrganization(t *testing.T) {
603605
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID, func(cwr *codersdk.CreateWorkspaceRequest) {
604606
cwr.TTLMillis = nil // ensure that no default TTL is set
605607
})
608+
coderdtest.AwaitWorkspaceBuildJob(t, client, workspace.LatestBuild.ID)
609+
606610
// TTL should be set by the template
607611
require.Equal(t, template.DefaultTTLMillis, templateTTL)
608612
require.Equal(t, template.DefaultTTLMillis, *workspace.TTLMillis)

0 commit comments

Comments
 (0)