gnodet opened a new pull request, #22989: URL: https://github.com/apache/camel/pull/22989
[CAMEL-13629](https://issues.apache.org/jira/browse/CAMEL-13629) ## Summary - Fix and re-enable `DisruptorReconfigureWithBlockingProducerTest`, which has been `@Disabled` since 2019 ## Root causes of flakiness 1. **Fragile wall-clock timing assertion** (`watch.taken() < 2000`): only 400ms margin over the theoretical 1600ms drain time, easily exceeded on slow CI machines 2. **Race between producer and reconfiguration**: the `ConsumerEventHandler` processes events asynchronously (calls `processor.process()` with a no-op callback and returns immediately), so the ring buffer drains in microseconds. The producer could send all 12 messages to the OLD disruptor before `addRoutes()` nullified the reference, causing `mock:b` to receive far fewer messages than expected 3. **Non-volatile `exception` field** across threads and tight 5-second timeouts ## Changes - Remove `@Disabled` annotation to re-enable the test - Use explicit `CountDownLatch` synchronization: producer sends a first batch of 8 messages, signals, then waits for reconfiguration to complete before sending the second batch of 12 messages. This ensures the second batch deterministically goes through both consumers - Use `blockWhenFull=true` on the producer URI (matching the test's name) - Remove the fragile `StopWatch` timing assertion - Make `exception` field `volatile` for proper cross-thread visibility - Increase timeouts to generous values (10s/30s) and add explicit timeout to `MockEndpoint.assertIsSatisfied` - Add proper error handling with `finally` for `resultLatch` Verified stable with 10/10 consecutive passes locally and full disruptor test suite (102 tests). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
