Skip to content

chore: camel-plc4x - run Plc4XRepeatedFailureRouteTest isolated - #28559

Merged
davsclaus merged 1 commit into
mainfrom
chore-plc4x-isolated-log-tests
Oct 27, 2026
Merged

davsclaus merged 1 commit into
mainfrom
chore-plc4x-isolated-log-tests

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Description

Follow-up of the gnodet-bot review on #28556 (CAMEL-26339). LogCapture sets the level of a logger for the whole JVM, and MockDriver is programmed statically. So Plc4XRepeatedFailureRouteTest is now @Isolated and does not run at the same time as other test classes when JUnit parallel execution is on (camel.surefire.parallel=true). The Javadoc of LogCapture says so too. Test-only change.

Verification: mvn test in components/camel-plc4x with -Dcamel.surefire.parallel=true -Dcamel.surefire.parallel.factor=4 -Dsurefire.rerunFailingTestsCount=0: 43 tests green, and Plc4XRepeatedFailureRouteTest ran alone after the other classes.

Claude Code on behalf of davsclaus

🤖 Generated with Claude Code

LogCapture sets the level of a logger for the whole JVM and MockDriver is
programmed statically, so the test must not run in parallel with other test
classes when JUnit parallel execution is turned on. Follow-up of the review of
#28556.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus davsclaus added this to the 4.24.0 milestone Oct 27, 2026
@davsclaus davsclaus added the test label Oct 27, 2026

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

Correct test-hygiene follow-up. Plc4XRepeatedFailureRouteTest asserts on captured log levels via LogCapture (which sets a logger's level JVM-wide) and uses the statically-programmed MockDriver, so it mutates process-global state — @Isolated is exactly the right JUnit 5 mechanism to keep it from running in parallel with other test classes, and the added doc note on LogCapture makes the constraint explicit for future callers. Small and clearly correct.

No blockers.

Claude Code on behalf of oscerd

@gnodet-bot gnodet-bot 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.

LGTM. @Isolated is the correct JUnit 5 mechanism here — it guarantees Plc4XRepeatedFailureRouteTest runs in its own execution group with no other test class running concurrently, which is exactly what's needed given LogCapture's JVM-global logger level mutation and MockDriver's static state. The added LogCapture Javadoc makes the constraint explicit for future consumers. No issues found.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@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:

  • components/camel-plc4x

🔁 1 test passed only after a retry on JDK 21 (1 retried attempt)

Recovered flaky tests on JDK 21 (1)
Module Test Failed attempts First failure
dsl/camel-jbang/camel-jbang-plugin-tui MonitorStartupTest.browserOnlyServesUntilTheServerStops 1 Connection refused

ℹ️ These tests did not fail the build. Surefire retried them and they passed.
Retries are enabled project-wide by surefire.rerunFailingTestsCount in parent/pom.xml.


🔬 Scalpel shadow comparison — Scalpel: 1 of 708 tested, 0 compile-only — current: 8 all tested

Maveniverse Scalpel detected 1 affected modules (current approach: 8).

Skip-tests mode would test 1 modules (1 direct + 0 downstream), skip tests for 0 (generated code, meta-modules)

Modules only in current approach (7)
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules Scalpel would test (1)
  • camel-plc4x ← components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/LogCapture.java, components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/Plc4XRepeatedFailureRouteTest.java

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (8 modules, 2m 22s total)

Total reactor time: 2m 22s

Module Duration Status
Camel :: JBang :: MCP 41.9s SUCCESS
Camel :: JBang :: Plugin :: Validate 37.6s SUCCESS
Camel :: PLC4X 32.4s SUCCESS
Camel :: YAML DSL :: Validator 22.5s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 3.3s SUCCESS
Camel :: JBang :: Plugin :: MCP 2.9s SUCCESS
Camel :: Launcher :: Container 1.6s SUCCESS
Camel :: JBang :: Plugin :: TUI n/a

Top 20 slowest modules:

  • Camel :: JBang :: MCP (41.9s)
  • Camel :: JBang :: Plugin :: Validate (37.6s)
  • Camel :: PLC4X (32.4s)
  • Camel :: YAML DSL :: Validator (22.5s)
  • Camel :: YAML DSL :: Validator Maven Plugin (3.3s)
  • Camel :: JBang :: Plugin :: MCP (2.9s)
  • Camel :: Launcher :: Container (1.6s)

⚙️ View full build and test results

@davsclaus
davsclaus merged commit 740c238 into main Oct 27, 2026
6 checks passed
@davsclaus
davsclaus deleted the chore-plc4x-isolated-log-tests branch October 27, 2026 11:54
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