Repository navigation
chore: camel-core - RouteStopCutOffLog tests must not run in parallel with each other - #29193
Conversation
… with each other RouteStopCutOffLogTest and RouteStopCutOffLogNestedTest both capture the DefaultErrorHandler logger with ConsumingAppender, which replaces the logger config, and both remove it after each test. When the two classes run at the same time they wipe out each other's appender and see no WARN line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet-bot
left a comment
There was a problem hiding this comment.
LGTM. Both test classes correctly use @ResourceLock("DefaultErrorHandlerLogger") to serialize access to the shared Log4j2 appender, preventing the race condition between parallel test executions. The fix is minimal, targeted, and follows established JUnit 5 patterns.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
🧪 CI tested the following changed modules:
🔁 2 tests passed only after a retry on JDK 21 (2 retried attempts) Recovered flaky tests on JDK 21 (2)
🔬 Scalpel shadow comparison — Scalpel: 25 of 713 tested, 0 compile-only — current: 0 all testedMaveniverse Scalpel detected 25 affected modules (current approach: 0). Skip-tests mode would test 25 modules (1 direct + 24 downstream), skip tests for 0 (generated code, meta-modules)
|
| Module | Duration | Status |
|---|---|---|
| Camel :: jOOR | 51.6s | SUCCESS |
| Camel :: QuickJS | 51.3s | SUCCESS |
| Camel :: DataSonnet | 50.9s | SUCCESS |
| Camel :: Main | 41.7s | SUCCESS |
| Camel :: Console | 39.2s | SUCCESS |
| Camel :: Python 3 | 31.5s | SUCCESS |
| Camel :: HL7 | 29.3s | SUCCESS |
| Camel :: Groovy | 23.9s | SUCCESS |
| Camel :: XML DSL with camel-xml-io | 17.1s | SUCCESS |
| Camel :: Saxon | 17.1s | SUCCESS |
| Camel :: JSon Path | 17.0s | SUCCESS |
| Camel :: XML DSL with camel-xml-jaxb | 15.5s | SUCCESS |
| Camel :: StAX | 15.4s | SUCCESS |
| Camel :: Python | 9.5s | SUCCESS |
| Camel :: JQ | 8.7s | SUCCESS |
| Camel :: XML DSL Jaxb :: Test :: Definition | 7.3s | SUCCESS |
| Camel :: JavaScript | 7.3s | SUCCESS |
| Camel :: XML DSL Jaxb :: Test :: Spring | 6.7s | SUCCESS |
| Camel :: Platform HTTP :: Jolokia | 5.9s | SUCCESS |
| Camel :: Jactl | 4.8s | SUCCESS |
| Camel :: OGNL (deprecated) | 4.2s | SUCCESS |
| Camel :: MVEL | 3.2s | SUCCESS |
| Camel :: Core | n/a | |
| Camel :: Management | n/a | |
| Camel :: Spring XML | n/a |
Top 20 slowest modules:
Camel :: jOOR(51.6s)Camel :: QuickJS(51.3s)Camel :: DataSonnet(50.9s)Camel :: Main(41.7s)Camel :: Console(39.2s)Camel :: Python 3(31.5s)Camel :: HL7(29.3s)Camel :: Groovy(23.9s)Camel :: XML DSL with camel-xml-io(17.1s)Camel :: Saxon(17.1s)Camel :: JSon Path(17.0s)Camel :: XML DSL with camel-xml-jaxb(15.5s)Camel :: StAX(15.4s)Camel :: Python(9.5s)Camel :: JQ(8.7s)Camel :: XML DSL Jaxb :: Test :: Definition(7.3s)Camel :: JavaScript(7.3s)Camel :: XML DSL Jaxb :: Test :: Spring(6.7s)Camel :: Platform HTTP :: Jolokia(5.9s)Camel :: Jactl(4.8s)
oscerd
left a comment
There was a problem hiding this comment.
Correct and minimal. Both RouteStopCutOffLog tests swap and restore the DefaultErrorHandler logger's appender to count warn lines, so running them concurrently let one test's appender changes bleed into the other, which is the expected: <1> but was: <0> and the appender ConditionTimeout failures seen on recent core runs. @ResourceLock("DefaultErrorHandlerLogger") with a shared key serialises just those two against each other, which is more targeted than @Isolated would be. LGTM.
Claude Code on behalf of oscerd
RouteStopCutOffLogTestandRouteStopCutOffLogNestedTestboth capture theDefaultErrorHandlerlogger withConsumingAppender.newAppender(). That call removes the logger config and installs a new one, and each class's@AfterEachremoves the config as well. camel-core runs test classes concurrently, so when the two classes overlap they wipe out each other's appender and capture no WARN line. Filtering on thread name only separates events, so it cannot help once the appender is gone.The race appeared when #28147 added the second class. It failed the camel-core build of #29190 three times in a row:
RouteStopCutOffLogTest.theCutOffIsOneWarnLine:90» ConditionTimeout (no message within 5 seconds)RouteStopCutOffLogNestedTest.multicastSplitCutOffIsOneWarnLine:183expected: <1> but was: <0>The fix puts
@ResourceLock("DefaultErrorHandlerLogger")on both classes, so they never run at the same time but still run in parallel with the rest of the module.Test: both classes pass locally (
-Dtest='RouteStopCutOffLog*Test').Claude Code on behalf of davsclaus
🤖 Generated with Claude Code