This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch chore-plc4x-isolated-log-tests
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4272e03ade1e6e448ec19702eba27d6f09d1ffcc
Author: Claus Ibsen <[email protected]>
AuthorDate: Tue Oct 27 11:22:42 2026 +0100

    chore: camel-plc4x - run Plc4XRepeatedFailureRouteTest isolated
    
    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) <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../src/test/java/org/apache/camel/component/plc4x/LogCapture.java   | 3 ++-
 .../apache/camel/component/plc4x/Plc4XRepeatedFailureRouteTest.java  | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/LogCapture.java
 
b/components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/LogCapture.java
index d195ec71c720..8adf45ae1345 100644
--- 
a/components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/LogCapture.java
+++ 
b/components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/LogCapture.java
@@ -28,7 +28,8 @@ import org.apache.logging.log4j.core.config.Property;
 
 /**
  * Captures the log events of one logger, down to DEBUG, while it is open. 
Only one capture is open at a time: opening
- * another one resets the level of the loggers.
+ * another one resets the level of the loggers. The level is set for the whole 
JVM, so a test class that uses it is
+ * {@code @Isolated} and does not run in parallel with other test classes.
  */
 final class LogCapture extends AbstractAppender implements AutoCloseable {
 
diff --git 
a/components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/Plc4XRepeatedFailureRouteTest.java
 
b/components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/Plc4XRepeatedFailureRouteTest.java
index 4e897e9762a3..29af2b5239c1 100644
--- 
a/components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/Plc4XRepeatedFailureRouteTest.java
+++ 
b/components/camel-plc4x/src/test/java/org/apache/camel/component/plc4x/Plc4XRepeatedFailureRouteTest.java
@@ -32,6 +32,7 @@ import org.apache.plc4x.java.api.exceptions.PlcException;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.parallel.Isolated;
 
 import static org.awaitility.Awaitility.await;
 import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -46,7 +47,11 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
  * at WARN and the end of the run at INFO, instead of a WARN with a stack 
trace on every poll, while
  * {@code bridgeErrorHandler} still gets every failure. Without {@code 
autoReconnect}, a lost connection shuts the
  * endpoint down once, and the triggered consumer stops polling until the 
route is restarted.
+ * <p>
+ * Isolated because {@link LogCapture} changes the level of a logger of the 
JVM and {@link MockDriver} is programmed
+ * statically, so another test class must not run at the same time.
  */
+@Isolated
 public class Plc4XRepeatedFailureRouteTest extends CamelTestSupport {
 
     private static final String PLC = 
"plc4x:mock:10.10.10.1/1/1?trigger=TRIG&period=50&tag.temperature=TEMP";

Reply via email to