Skip to content

Commit 78346f3

Browse files
committed
Try fixing Windows deadlock
1 parent 7994fd0 commit 78346f3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.net.URISyntaxException;
2525
import java.nio.file.Files;
2626
import java.nio.file.Path;
27+
import java.nio.file.attribute.FileTime;
2728
import java.util.concurrent.CountDownLatch;
2829
import org.apache.logging.log4j.Logger;
2930
import org.apache.logging.log4j.core.LoggerContext;
@@ -64,6 +65,13 @@ static void beforeEach() throws Exception {
6465
Path.of(requireNonNull(RollingAppenderCronTest.class.getResource("RollingAppenderCronTest.old.xml"))
6566
.toURI());
6667
Files.copy(src, CONFIG, REPLACE_EXISTING);
68+
// Set modification time to the start of the epoch, in order for modification detection to work on every OS.
69+
Files.setLastModifiedTime(CONFIG, FileTime.fromMillis(0L));
70+
}
71+
72+
@AfterAll
73+
static void cleanUp() throws Exception {
74+
Files.deleteIfExists(CONFIG);
6775
}
6876

6977
@AfterAll

0 commit comments

Comments
 (0)