mirror of
https://github.com/shankar0123/certctl.git
synced 2026-06-07 21:31:34 +00:00
4655f68e87
The audit middleware records events asynchronously via goroutines. Tests previously used time.Sleep(50ms) to wait for audit recording, which is unreliable. Implemented waitableAuditRecorder wrapper that: - Wraps mockAuditRecorder to intercept RecordAPICall invocations - Signals via buffered channel when recording completes - Provides Wait(timeout) method for tests to synchronously wait - Returns true on successful wait, false on timeout Replaced all 7 time.Sleep(50ms) calls with recorder.Wait(1*time.Second) calls, improving test reliability and reducing flakiness. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>