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

Lines changed: 4 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy