Skip to content

CAMEL-24042: Fix flaky tests in camel-core (batch 10)#24650

Merged
gnodet merged 1 commit into
apache:mainfrom
gnodet:fix/CAMEL-24042-fix-flaky-tests-batch10
Jul 13, 2026
Merged

CAMEL-24042: Fix flaky tests in camel-core (batch 10)#24650
gnodet merged 1 commit into
apache:mainfrom
gnodet:fix/CAMEL-24042-fix-flaky-tests-batch10

Conversation

@gnodet

@gnodet gnodet commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix flaky tests identified by Develocity in camel-core:

  • ThrottlingExceptionRoutePolicyOpenViaConfigTest: Increase Awaitility timeouts from 5s to 10s
  • DistributedTimeoutTest: Increase Awaitility timeout from 5s to 10s
  • MockEndpointTimeClauseTest: Replace 8× bare assertMockEndpointsSatisfied() with MockEndpoint.assertIsSatisfied(context, 30, TimeUnit.SECONDS) (2 intentional bare calls left: assertThrows and timing-critical test)
  • FileProducerNoForcedWritesTest: Replace assertMockEndpointsSatisfied() with timed variant
  • StopTimeoutRouteTest: Replace assertMockEndpointsSatisfied() with timed variant
  • ForegroundTaskTest: Increase @Timeout from 10s to 20s (slow test predicates sleep 2s/iteration, tight under CI load)
  • ForegroundTimeTaskTest: Increase @Timeout from 10s to 20s

Test plan

  • All 28 test methods pass locally (0 failures)
  • Code formatted with mvn formatter:format impsort:sort

Claude Code on behalf of gnodet

🤖 Generated with Claude Code

Use timed MockEndpoint assertions, increase Awaitility and @timeout
timeouts to reduce flakiness under CI load for throttle, mock, task,
file and stop-timeout tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the core label Jul 13, 2026
@github-actions

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

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 13, 2026 08:45
@gnodet gnodet requested review from davsclaus and oscerd July 13, 2026 08:45

@oscerd oscerd 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.

Reviewed each changed test for the project's async-testing rules (no Thread.sleep, condition-based waits, MockEndpoint timed assertions, no Awaitility-wrapping of assertIsSatisfied) — all clean, no change requests. Notes from the verification:

  • The assertMockEndpointsSatisfied()MockEndpoint.assertIsSatisfied(context, 30, TimeUnit.SECONDS) migrations are semantically the same latch-based wait with the implicit 10s default raised to an explicit 30s — exactly the pattern the repo guidelines prescribe. The two bare assertIsSatisfied() calls deliberately left in MockEndpointTimeClauseTest are correct as-is (one is inside assertThrows, the other gates a latch on the default wait).
  • The @Timeout(10)@Timeout(20) bumps in ForegroundTaskTest/ForegroundTimeTaskTest are pure hang-guards: task time-boundedness is still asserted by each task's own withMaxDuration budget and iteration-count assertions, so nothing is weakened. The arithmetic checks out (slow-predicate tests have ~6s nominal runtime, leaving only ~4s headroom under the old value).
  • No assertion is weakened anywhere in the batch: expected message counts, exactly-once invocation checks (invoked.get() == 1 in DistributedTimeoutTest), and upper/lower-bound duration asserts are all unchanged.
  • One observation for the series rather than this PR: the whole batch is timeout-headroom on waits that prior batches already made condition-based — which is the right remaining lever. DistributedTimeoutTest:54 is now on its second escalation (2s→5s in CAMEL-24037/#24635, 5s→10s here) for an aggregator with a 200ms completion timeout; if it flakes a third time, it may deserve a look at what actually stalls the timeout checker on loaded CI instead of another bump.

CI is green on both JDK 17 and 25 builds (which run the camel-core tests).

Reviewed with Claude Code (Fable 5) on behalf of oscerd. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

@gnodet gnodet added this to the 4.22.0 milestone Jul 13, 2026
@gnodet gnodet self-assigned this Jul 13, 2026
@gnodet gnodet added the test label Jul 13, 2026
@gnodet gnodet merged commit d4a1841 into apache:main Jul 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants