mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08: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)
|
interval := next.Sub(testCase.at)
|
||||||
require.Equal(t, testCase.expectedInterval, interval, "unexpected interval")
|
require.Equal(t, testCase.expectedInterval, interval, "unexpected interval")
|
||||||
|
|
||||||
require.Len(t, auditor.AuditLogs, 7)
|
require.Eventually(t, func() bool {
|
||||||
assert.Equal(t, database.AuditActionWrite, auditor.AuditLogs[6].Action)
|
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