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 d195ec71c720b..8adf45ae1345d 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 @@ /** * 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 4e897e9762a3f..29af2b5239c1d 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.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 @@ * 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. + *

+ * 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";