mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 02:25:56 +00:00
8e5ef365d4
Tests swapped the package-level newTimerFn hook while async goroutines leaked from earlier tests (backup-cleanup and stop-command paths) were still reading it in waitForAsyncDelay, tripping the race detector on CI. Replace the global with a per-Agent newTimerFn seam (nil defaults to time.NewTimer), make waitForContextDelay an Agent method, and inject the immediate timer into the tests that previously swapped the global. Verified with go test ./internal/dockeragent/ -race -count=20. Contract-Neutral: test seam refactor to fix data race, no public contract delta Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>