61513aca04
The test assumed webhook events arrive in wall-clock order (queued first, done last), but dispatcher.Fire spawns a goroutine per event with no ordering guarantee. On a single-core CI runner the "queued" goroutine was routinely preempted before making its HTTP POST, letting "loading"/"working"/"done" goroutines land first. Fix: wait until a "done" event appears in the received set (proving all prior transitions have been dispatched by the worker), then assert that "queued" and "done" each appear exactly once rather than checking positional order. Reproduced with: GOMAXPROCS=1 go test -race -count=100 -run TestWebhook_LifecycleEvents ./internal/server/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>