You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by pk...@apache.org on 2024/04/03 13:56:04 UTC
(logging-log4j2) branch main updated: Try fixing Windows deadlock
This is an automated email from the ASF dual-hosted git repository.
pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/main by this push:
new 78346f333b Try fixing Windows deadlock
78346f333b is described below
commit 78346f333bbacf3eb3af2d0a1f576eb54ed23620
Author: Piotr P. Karwasz <pi...@karwasz.org>
AuthorDate: Wed Apr 3 15:07:30 2024 +0200
Try fixing Windows deadlock
---
.../log4j/core/appender/rolling/RollingAppenderCronTest.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java
index ec4effaaf0..3218f2a169 100644
--- a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java
+++ b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/rolling/RollingAppenderCronTest.java
@@ -24,6 +24,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.nio.file.attribute.FileTime;
import java.util.concurrent.CountDownLatch;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LoggerContext;
@@ -64,6 +65,13 @@ class RollingAppenderCronTest extends AbstractRollingListenerTest {
Path.of(requireNonNull(RollingAppenderCronTest.class.getResource("RollingAppenderCronTest.old.xml"))
.toURI());
Files.copy(src, CONFIG, REPLACE_EXISTING);
+ // Set modification time to the start of the epoch, in order for modification detection to work on every OS.
+ Files.setLastModifiedTime(CONFIG, FileTime.fromMillis(0L));
+ }
+
+ @AfterAll
+ static void cleanUp() throws Exception {
+ Files.deleteIfExists(CONFIG);
}
@AfterAll