Skip to content

CAMEL-23900: Fix flaky RecipientListParallelStreamingTest#24415

Merged
gnodet merged 1 commit into
apache:mainfrom
gnodet:camel-23900-fix-flaky-test-recipientlistparallels
Jul 4, 2026
Merged

CAMEL-23900: Fix flaky RecipientListParallelStreamingTest#24415
gnodet merged 1 commit into
apache:mainfrom
gnodet:camel-23900-fix-flaky-test-recipientlistparallels

Conversation

@gnodet

@gnodet gnodet commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Claude Code on behalf of Guillaume Nodet

Fix flaky RecipientListParallelStreamingTest#testRecipientListParallel that fails on both JDK 17 and JDK 25.

  • Split the single test method into two isolated methods (testRecipientListParallel and testRecipientListParallelStreaming) to eliminate mock state contamination via reset()
  • Increase delay gaps from 100ms/500ms to 500ms/2000ms so the completion ordering for the streaming case is deterministic even on busy CI systems (matching the pattern used in MulticastParallelStreamingTest)
  • Replace assertMockEndpointsSatisfied() with Awaitility await().untilAsserted() per project testing guidelines

Root cause

The streaming test relies on direct:b (previously 500ms delay) being the last recipient to complete so that UseLatestAggregationStrategy picks body "b". With only a 400ms gap over direct:a (100ms delay), CI thread scheduling jitter could collapse the gap and produce the wrong aggregation result.

Test plan

  • RecipientListParallelStreamingTest passes reliably (verified 5 consecutive runs)
  • CI build passes

🤖 Generated with Claude Code

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>
@gnodet gnodet requested review from aldettinger and davsclaus July 4, 2026 15:17
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the core label Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • core/camel-core

🔬 Scalpel shadow comparison — Scalpel: 23 tested, 0 compile-only — current: 0 all tested

Maveniverse Scalpel detected 23 affected modules (current approach: 0).

⚠️ Modules only in Scalpel (23)
  • camel-console
  • camel-core
  • camel-csimple-joor
  • camel-datasonnet
  • camel-groovy
  • camel-hl7
  • camel-javascript
  • camel-joor
  • camel-jq
  • camel-jsonpath
  • camel-main
  • camel-management
  • camel-mvel
  • camel-ognl
  • camel-platform-http-jolokia
  • camel-python
  • camel-saxon
  • camel-spring-xml
  • camel-stax
  • camel-xml-io-dsl
  • camel-xml-jaxb-dsl
  • camel-xml-jaxb-dsl-test-definition
  • camel-xml-jaxb-dsl-test-spring

Skip-tests mode would test 23 modules (1 direct + 22 downstream), skip tests for 0 (generated code, meta-modules)

Modules Scalpel would test (23)
  • camel-console
  • camel-core
  • camel-csimple-joor
  • camel-datasonnet
  • camel-groovy
  • camel-hl7
  • camel-javascript
  • camel-joor
  • camel-jq
  • camel-jsonpath
  • camel-main
  • camel-management
  • camel-mvel
  • camel-ognl
  • camel-platform-http-jolokia
  • camel-python
  • camel-saxon
  • camel-spring-xml
  • camel-stax
  • camel-xml-io-dsl
  • camel-xml-jaxb-dsl
  • camel-xml-jaxb-dsl-test-definition
  • camel-xml-jaxb-dsl-test-spring

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • core/camel-core: 2 test(s) disabled on GitHub Actions
All tested modules (23 modules)
  • Camel :: Console
  • Camel :: Core
  • Camel :: DataSonnet
  • Camel :: Groovy
  • Camel :: HL7
  • Camel :: JQ
  • Camel :: JSon Path
  • Camel :: JavaScript
  • Camel :: MVEL
  • Camel :: Main
  • Camel :: Management
  • Camel :: OGNL (deprecated)
  • Camel :: Platform HTTP :: Jolokia
  • Camel :: Python
  • Camel :: Saxon
  • Camel :: Spring XML
  • Camel :: StAX
  • Camel :: XML DSL Jaxb :: Test :: Definition
  • Camel :: XML DSL Jaxb :: Test :: Spring
  • Camel :: XML DSL with camel-xml-io
  • Camel :: XML DSL with camel-xml-jaxb
  • Camel :: csimple jOOR (deprecated)
  • Camel :: jOOR

⚙️ View full build and test results

@gnodet gnodet marked this pull request as ready for review July 4, 2026 15:52
@gnodet gnodet requested a review from Copilot July 4, 2026 16:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (testRecipientListParallel and testRecipientListParallelStreaming) to avoid cross-test mock state interaction.
  • Increased direct:a/direct:b delays to widen completion-time gaps so the streaming aggregation result is stable on busy CI.
  • Replaced assertMockEndpointsSatisfied() with an Awaitility-based wait around MockEndpoint#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");
Comment on lines +59 to +60
from("direct:a").delay(500).syncDelayed().transform(constant("a"));
from("direct:b").delay(2000).syncDelayed().transform(constant("b"));
@gnodet gnodet merged commit 7dd0473 into apache:main Jul 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants