This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch chore/route-stop-cutoff-log-resource-lock in repository https://gitbox.apache.org/repos/asf/camel.git
commit f8c86031a5cfdf612f5b8aaed67b4e741a35dbfd Author: Claus Ibsen <[email protected]> AuthorDate: Wed Nov 4 22:01:05 2026 +0100 chore: camel-core - RouteStopCutOffLog tests must not run in parallel 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 <[email protected]> Signed-off-by: Claus Ibsen <[email protected]> --- .../camel/processor/errorhandler/RouteStopCutOffLogNestedTest.java | 3 +++ .../apache/camel/processor/errorhandler/RouteStopCutOffLogTest.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/RouteStopCutOffLogNestedTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/RouteStopCutOffLogNestedTest.java index 07782de8bbde..ab9595ea305d 100644 --- a/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/RouteStopCutOffLogNestedTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/RouteStopCutOffLogNestedTest.java @@ -34,6 +34,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.LoggerContext; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -64,6 +65,8 @@ import static org.junit.jupiter.api.Assertions.fail; * handlers and the caller's running handler see the flag and skip. The WARN count is asserted after the exchange * completes. */ +// both RouteStopCutOffLog tests replace and remove the appender of the DefaultErrorHandler logger +@ResourceLock("DefaultErrorHandlerLogger") public class RouteStopCutOffLogNestedTest extends ContextTestSupport { private static final String LOGGER = DefaultErrorHandler.class.getName(); diff --git a/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/RouteStopCutOffLogTest.java b/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/RouteStopCutOffLogTest.java index d8075554f11f..69c39f46abd0 100644 --- a/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/RouteStopCutOffLogTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/processor/errorhandler/RouteStopCutOffLogTest.java @@ -34,6 +34,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.core.LoggerContext; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.ResourceLock; import static org.awaitility.Awaitility.await; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -47,6 +48,8 @@ import static org.junit.jupiter.api.Assertions.fail; * CAMEL-25484: an exchange that a route stop or a dev mode reload cuts off is logged as one WARN line, not as an * exhausted failure with message history and stack trace; CAMEL-25502: and is not recorded in the error registry. */ +// both RouteStopCutOffLog tests replace and remove the appender of the DefaultErrorHandler logger +@ResourceLock("DefaultErrorHandlerLogger") public class RouteStopCutOffLogTest extends ContextTestSupport { private static final String LOGGER = DefaultErrorHandler.class.getName();
