Skip to content

Commit b693b9f

Browse files
authored
chore: fix workspace audit log flake (#6494)
This happened because sometimes a build would be queued and completed intermittently in CI. See https://github.com/coder/coder/actions/runs/4358121985/jobs/7618290591
1 parent 1f9ae15 commit b693b9f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

coderd/workspaces_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,10 @@ func TestPostWorkspacesByOrganization(t *testing.T) {
269269
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
270270
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
271271
coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
272-
_ = coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
272+
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
273+
coderdtest.AwaitWorkspaceBuildJob(t, client, workspace.LatestBuild.ID)
273274

274-
require.Len(t, auditor.AuditLogs, 5)
275+
require.Len(t, auditor.AuditLogs, 6)
275276
assert.Equal(t, database.AuditActionCreate, auditor.AuditLogs[4].Action)
276277
})
277278

0 commit comments

Comments
 (0)