Skip to content

Commit ea99e19

Browse files
committed
fixup! chore(coderd/workspaceapps/apptest): fix test flake due to concurrent usage of same deployment
1 parent 91ecf37 commit ea99e19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

coderd/workspaceapps/apptest/apptest.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,9 +1766,10 @@ func assertWorkspaceLastUsedAtUpdated(t testing.TB, details *Details) {
17661766
require.NoError(t, err)
17671767
// Wait for stats to fully flush.
17681768
details.FlushStats()
1769-
after, err := details.SDKClient.Workspace(context.Background(), details.Workspace.ID)
1770-
require.NoError(t, err)
1771-
require.Greater(t, after.LastUsedAt, before.LastUsedAt, "workspace LastUsedAt not updated when it should have been")
1769+
require.Eventually(t, func() bool {
1770+
after, err := details.SDKClient.Workspace(context.Background(), details.Workspace.ID)
1771+
return assert.NoError(t, err) && after.LastUsedAt.After(before.LastUsedAt)
1772+
}, testutil.WaitShort, testutil.IntervalMedium)
17721773
}
17731774

17741775
// Except when it sometimes shouldn't (e.g. no access)

0 commit comments

Comments
 (0)