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

vy pushed a commit to branch 2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/2.x by this push:
     new 4852d1255c Fix state leakage in `AbstractAsyncThreadContextTestBase` 
(#3945)
4852d1255c is described below

commit 4852d1255c011ec757f5d06564f9408857b51423
Author: Kevin Cruz <[email protected]>
AuthorDate: Mon Oct 13 04:35:04 2025 -0500

    Fix state leakage in `AbstractAsyncThreadContextTestBase` (#3945)
---
 .../log4j/core/async/AbstractAsyncThreadContextTestBase.java        | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/AbstractAsyncThreadContextTestBase.java
 
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/AbstractAsyncThreadContextTestBase.java
index 572b2ca4d5..0274a934f4 100644
--- 
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/AbstractAsyncThreadContextTestBase.java
+++ 
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/AbstractAsyncThreadContextTestBase.java
@@ -48,6 +48,7 @@ import 
org.apache.logging.log4j.test.junit.UsingTestProperties;
 import org.apache.logging.log4j.util.ProviderUtil;
 import org.apache.logging.log4j.util.Unbox;
 import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.parallel.ResourceLock;
 
 @UsingStatusListener
@@ -59,6 +60,11 @@ public abstract class AbstractAsyncThreadContextTestBase {
 
     private static TestProperties props;
 
+    @BeforeEach
+    public void beforeEach() {
+        ThreadContext.clearAll();
+    }
+
     @BeforeAll
     public static void beforeClass() {
         props.setProperty("log4j2.enableThreadlocals", true);

Reply via email to