Skip to content

Commit 4852d12

Browse files
authored
Fix state leakage in AbstractAsyncThreadContextTestBase (#3945)
1 parent e9556bb commit 4852d12

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

log4j-core-test/src/test/java/org/apache/logging/log4j/core/async/AbstractAsyncThreadContextTestBase.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import org.apache.logging.log4j.util.ProviderUtil;
4949
import org.apache.logging.log4j.util.Unbox;
5050
import org.junit.jupiter.api.BeforeAll;
51+
import org.junit.jupiter.api.BeforeEach;
5152
import org.junit.jupiter.api.parallel.ResourceLock;
5253

5354
@UsingStatusListener
@@ -59,6 +60,11 @@ public abstract class AbstractAsyncThreadContextTestBase {
5960

6061
private static TestProperties props;
6162

63+
@BeforeEach
64+
public void beforeEach() {
65+
ThreadContext.clearAll();
66+
}
67+
6268
@BeforeAll
6369
public static void beforeClass() {
6470
props.setProperty("log4j2.enableThreadlocals", true);

0 commit comments

Comments
 (0)