File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
coderd/workspaceapps/apptest Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1765,9 +1765,11 @@ func assertWorkspaceLastUsedAtUpdated(t testing.TB, details *Details) {
17651765 require .NotNil (t , details .Workspace , "can't assert LastUsedAt on a nil workspace!" )
17661766 before , err := details .SDKClient .Workspace (context .Background (), details .Workspace .ID )
17671767 require .NoError (t , err )
1768- // Wait for stats to fully flush.
1769- details .FlushStats ()
17701768 require .Eventually (t , func () bool {
1769+ // We may need to flush multiple times, since the stats from the app we are testing might be
1770+ // collected asynchronously from when we see the connection close, and thus, could race
1771+ // against being flushed.
1772+ details .FlushStats ()
17711773 after , err := details .SDKClient .Workspace (context .Background (), details .Workspace .ID )
17721774 return assert .NoError (t , err ) && after .LastUsedAt .After (before .LastUsedAt )
17731775 }, testutil .WaitShort , testutil .IntervalMedium )
You can’t perform that action at this time.
0 commit comments