CAMEL-23900: Fix flaky RecipientListParallelStreamingTest#24415
Conversation
The streaming test relied on completion ordering from small delays (100ms/500ms) that collapsed under CI thread scheduling jitter, causing the UseLatestAggregationStrategy to pick the wrong result. - Split single test into two isolated methods to avoid mock state contamination via reset() - Increase delay gaps to 500ms/2000ms (matching the pattern in MulticastParallelStreamingTest) so completion ordering is deterministic even on busy systems - Replace assertMockEndpointsSatisfied() with Awaitility await().untilAsserted() per project testing guidelines Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 23 tested, 0 compile-only — current: 0 all testedMaveniverse Scalpel detected 23 affected modules (current approach: 0).
|
There was a problem hiding this comment.
Pull request overview
This PR fixes flakiness in RecipientListParallelStreamingTest by isolating test cases and making timing-based ordering deterministic under parallel + streaming execution.
Changes:
- Split the previous combined scenario into two separate tests (
testRecipientListParallelandtestRecipientListParallelStreaming) to avoid cross-test mock state interaction. - Increased
direct:a/direct:bdelays to widen completion-time gaps so the streaming aggregation result is stable on busy CI. - Replaced
assertMockEndpointsSatisfied()with an Awaitility-based wait aroundMockEndpoint#assertIsSatisfied().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -30,14 +34,17 @@ public void testRecipientListParallel() throws Exception { | |||
|
|
|||
| template.sendBodyAndHeader("direct:start", "Hello World", "foo", "direct:a,direct:b,direct:c"); | |||
| from("direct:a").delay(500).syncDelayed().transform(constant("a")); | ||
| from("direct:b").delay(2000).syncDelayed().transform(constant("b")); |
Summary
Claude Code on behalf of Guillaume Nodet
Fix flaky
RecipientListParallelStreamingTest#testRecipientListParallelthat fails on both JDK 17 and JDK 25.testRecipientListParallelandtestRecipientListParallelStreaming) to eliminate mock state contamination viareset()MulticastParallelStreamingTest)assertMockEndpointsSatisfied()with Awaitilityawait().untilAsserted()per project testing guidelinesRoot cause
The streaming test relies on
direct:b(previously 500ms delay) being the last recipient to complete so thatUseLatestAggregationStrategypicks body"b". With only a 400ms gap overdirect:a(100ms delay), CI thread scheduling jitter could collapse the gap and produce the wrong aggregation result.Test plan
RecipientListParallelStreamingTestpasses reliably (verified 5 consecutive runs)🤖 Generated with Claude Code