mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
fix: poll audit logs to ensure write is last (#6708)
This commit is contained in:
@ -1261,8 +1261,12 @@ func TestWorkspaceUpdateAutostart(t *testing.T) {
|
||||
interval := next.Sub(testCase.at)
|
||||
require.Equal(t, testCase.expectedInterval, interval, "unexpected interval")
|
||||
|
||||
require.Len(t, auditor.AuditLogs, 7)
|
||||
assert.Equal(t, database.AuditActionWrite, auditor.AuditLogs[6].Action)
|
||||
require.Eventually(t, func() bool {
|
||||
if len(auditor.AuditLogs) < 7 {
|
||||
return false
|
||||
}
|
||||
return auditor.AuditLogs[6].Action == database.AuditActionWrite
|
||||
}, testutil.WaitShort, testutil.IntervalFast)
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user