CAMEL-24600: Fix flaky test JmsConcurrentConsumerInOnlyTest.testConcurrentConsumers - #26181
CAMEL-24600: Fix flaky test JmsConcurrentConsumerInOnlyTest.testConcurrentConsumers#26181gnodet wants to merge 1 commit into
Conversation
apupier
left a comment
There was a problem hiding this comment.
several unrelated changes
…rrentConsumers Replace MockEndpoint.assertIsSatisfied(context) with MockEndpoint.assertIsSatisfied(context, 30, TimeUnit.SECONDS) to use an explicit 30-second timeout instead of the default 10-second wait, which is insufficient on slow architectures (s390x, aarch64) or under CI load. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
e1ff46e to
9d522fb
Compare
|
🌟 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: 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, 3m 2s total)Total reactor time: 3m 2s
Top 20 slowest modules:
|
gnodet
left a comment
There was a problem hiding this comment.
Re-reviewing after the latest commit (9d522fb). The previous CHANGES_REQUESTED review ("several unrelated changes") was on an earlier iteration. The current PR modifies exactly one file with one logical change.
The fix is correct and ready to merge:
- Replaces the implicit 10-second
waitForCompleteLatchdefault with an explicit 30-second timeout — directly addressing the root cause of the flakiness on s390x/aarch64. - 30s is proportionate: 2000 messages × avg 5ms delay ÷ 2 concurrent threads ≈ 5s nominal; 30s leaves adequate headroom for slow CI architectures without bloating the test suite. The analogous
JmsDefaultTaskExecutorTypeTestuses 40s for a heavier workload — these are consistent. - Static analysis (ast-grep, semgrep): no findings.
- No unrelated changes remain — the CHANGES_REQUESTED concern has been fully addressed.
This review was generated by an AI agent, Hermès, on behalf of @gnodet.
apupier
left a comment
There was a problem hiding this comment.
on this one I feel there is something odd that might occur in the product code in some cases which could explain that it is 100x slower sometimes.
note that it doesn't fix the error on retries.
but we can try just to lower teh number of times it is flaky
Problem
JmsConcurrentConsumerInOnlyTest.testConcurrentConsumersis flaky — it has failed 13 times in 90 days, always on s390x.The test sends 2000 messages to a JMS queue through concurrent consumers (2-5) with random 0-10ms delays per message, then calls
MockEndpoint.assertIsSatisfied(context)with no explicit timeout. This falls back to the default 10-secondwaitForCompleteLatch, which is insufficient on slow architectures (s390x, aarch64) or under CI load.Fix
Replace
MockEndpoint.assertIsSatisfied(context)withMockEndpoint.assertIsSatisfied(context, 30, TimeUnit.SECONDS)to use an explicit 30-second timeout.This is consistent with
JmsDefaultTaskExecutorTypeTestin the same module, which already usesMockEndpoint.assertIsSatisfied(context, 40, TimeUnit.SECONDS).JIRA: https://issues.apache.org/jira/browse/CAMEL-24600
AI agent (Hermes on behalf of gnodet)