[Issue #57] Fix flaky NATSEventBus integration tests #58

Merged
HugoNijhuis merged 1 commits from issue-57 into main 2026-01-10 23:11:48 +00:00

1 Commits

Author SHA1 Message Date
18ea677585 Fix flaky NATSEventBus integration tests
Some checks failed
CI / build (pull_request) Successful in 18s
CI / integration (pull_request) Failing after 1m59s
CI / build (push) Successful in 18s
CI / integration (push) Failing after 1m58s
The integration tests had timing issues causing intermittent failures on CI:

- TestNATSEventBus_HighThroughput: Added subscriber readiness synchronization using a barrier event before bulk publishing. This ensures the NATS subscription is fully established before events are sent rapidly. Extended timeout from 30s to 60s for CI environments.

- TestNATSEventBus_EventOrdering: Added readiness barrier event to synchronize subscriber setup before publishing ordered events. Extended timeout from 10s to 15s to account for CI timing variations.

- TestNATSEventBus_ConcurrentPublishSubscribe: Added readiness synchronization before concurrent publishers start. Extended timeout from 10s to 30s to handle the increased load under CI constraints.

Root causes:
- Subscriber channels were not fully ready to receive when bulk publishing started, causing message loss
- CI runners (especially ARM64) have different timing characteristics than local development
- Insufficient timeouts for high-volume event collection under shared CI resources

The fixes use a barrier pattern: publish a ready signal, wait to receive it, then proceed with the test. This is more reliable than fixed sleep durations.

Closes #57

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 00:09:44 +01:00