CAMEL-23908: Fix flaky BacklogTracerAggregateTest#24424
Conversation
Use Awaitility to poll for backlog tracer events instead of asserting immediately after assertMockEndpointsSatisfied. The aggregate EIP processes the completed exchange asynchronously, so tracer events may not all be recorded yet when dumpAllTracedMessages is called. 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: 2 tested, 0 compile-only — current: 466 all testedMaveniverse Scalpel detected 2 affected modules (current approach: 466). Modules only in current approach (464)
Skip-tests mode would test 2 modules (1 direct + 1 downstream), skip tests for 0 (generated code, meta-modules) Modules Scalpel would test (2)
Build reactor — dependencies compiled but only changed modules were tested (2 modules)
|
There was a problem hiding this comment.
Pull request overview
This PR addresses flakiness in BacklogTracerAggregateTest.testBacklogTracerAggregate by accounting for asynchronous completion behavior in the Aggregate EIP, ensuring backlog tracer events have time to be recorded before assertions are evaluated.
Changes:
- Wrapped
dumpAllTracedMessagesand the “first/last” event count assertions in an Awaitilityawait().atMost(...).untilAsserted(...)block. - Added the necessary Awaitility static import and
TimeUnitimport to support bounded polling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Claude Code on behalf of Guillaume Nodet
BacklogTracerAggregateTest.testBacklogTracerAggregateincamel-management(reported on JDK 25)dumpAllTracedMessagesis called right afterassertMockEndpointsSatisfied()What changed
Wrapped the
dumpAllTracedMessages+ event count assertions in anawait().atMost(5, SECONDS).untilAsserted(...)block. This gives the backlog tracer time to record all events from the asynchronous aggregate completion processing.Test plan
🤖 Generated with Claude Code