CAMEL-23903: Fix flaky test RouteIdTransactedIT in camel-jms#24420
Draft
gnodet wants to merge 1 commit into
Draft
CAMEL-23903: Fix flaky test RouteIdTransactedIT in camel-jms#24420gnodet wants to merge 1 commit into
gnodet wants to merge 1 commit into
Conversation
Replace MockEndpoint.assertIsSatisfied(context) with Awaitility's untilAsserted() in both testRouteId() and testRouteIdFailed() to provide a generous 30-second timeout for transacted JMS message processing, which can exceed the default 10-second latch timeout under CI load on JDK 17. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
davsclaus
approved these changes
Jul 4, 2026
Contributor
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 1 tested, 0 compile-only — current: 12 all testedMaveniverse Scalpel detected 1 affected modules (current approach: 12). Modules only in current approach (11)
Skip-tests mode would test 1 modules (1 direct + 0 downstream), skip tests for 0 (generated code, meta-modules) Modules Scalpel would test (1)
All tested modules (12 modules)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix flaky
RouteIdTransactedIT.testRouteIdFailed(andtestRouteIdfor consistency) by replacingMockEndpoint.assertIsSatisfied(context)with Awaitility'suntilAsserted().Root cause: The default
MockEndpointlatch timeout is 10 seconds (waitForCompleteLatchdefaults to 10s whenresultWaitTime=0). In transacted JMS routes under CI load on JDK 17, the message processing (including transaction handling and exception routing viaonException) can exceed this timeout, causing intermittent test failures.Fix: Wrap mock endpoint assertions with
Awaitility.await().atMost(30, TimeUnit.SECONDS).untilAsserted(...)to give transacted routes a generous 30-second window. This follows the same Awaitility pattern already used elsewhere in camel-jms tests (e.g.,JmsAutoStartupTest,JmsDeliveryDelayTest).Test plan
RouteIdTransactedITpasses (2 tests, 0 failures)Claude Code on behalf of Guillaume Nodet
🤖 Generated with Claude Code