Skip to content

Commit 5ba866d

Browse files
committed
Try to stabilize certain tests with @RetryingTest
1 parent ee1c09f commit 5ba866d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

log4j-core-test/src/test/java/org/apache/logging/log4j/core/filter/HttpThreadContextMapFilterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
import org.junit.jupiter.api.AfterEach;
4848
import org.junit.jupiter.api.Assertions;
4949
import org.junit.jupiter.api.BeforeAll;
50-
import org.junit.jupiter.api.Test;
50+
import org.junitpioneer.jupiter.RetryingTest;
5151

5252
import static org.junit.jupiter.api.Assertions.assertNotEquals;
5353
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -111,7 +111,7 @@ public void after() {
111111
loggerContext = null;
112112
}
113113

114-
@Test
114+
@RetryingTest(maxAttempts = 5, suspendForMs = 10)
115115
public void filterTest() throws Exception {
116116
System.setProperty("log4j2.Configuration.allowedProtocols", "http");
117117
System.setProperty("logging.auth.username", "log4j");

log4j-core-test/src/test/java/org/apache/logging/log4j/core/filter/MutableThreadContextMapFilterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.apache.logging.log4j.core.test.appender.ListAppender;
3333
import org.junit.jupiter.api.AfterEach;
3434
import org.junit.jupiter.api.Assertions;
35-
import org.junit.jupiter.api.Test;
35+
import org.junitpioneer.jupiter.RetryingTest;
3636

3737
import static org.junit.jupiter.api.Assertions.*;
3838

@@ -59,7 +59,7 @@ public void after() {
5959
loggerContext = null;
6060
}
6161

62-
@Test
62+
@RetryingTest(maxAttempts = 5, suspendForMs = 10)
6363
public void filterTest() throws Exception {
6464
System.setProperty("configLocation", "target/test-classes/testConfig.json");
6565
ThreadContext.put("loginId", "rgoers");

0 commit comments

Comments
 (0)