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 354e779f99 Disable test on Fri 13th
354e779f99 is described below

commit 354e779f993f55ac9e0e985b1bbaef27003ca1e6
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Fri Sep 13 17:11:23 2024 +0200

    Disable test on Fri 13th
---
 .../appender/rolling/RollingAppenderDeleteScriptFri13thTest.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git 
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptFri13thTest.java
 
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptFri13thTest.java
index ac54422817..89ccdf4a57 100644
--- 
a/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptFri13thTest.java
+++ 
b/log4j-script/src/test/java/org/apache/logging/log4j/script/appender/rolling/RollingAppenderDeleteScriptFri13thTest.java
@@ -18,11 +18,14 @@ package org.apache.logging.log4j.script.appender.rolling;
 
 import static 
org.apache.logging.log4j.core.test.TestConstants.setSystemProperty;
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assume.assumeFalse;
 
 import java.io.IOException;
 import java.io.UncheckedIOException;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.LockSupport;
@@ -37,9 +40,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.RuleChain;
 
-/**
- *
- */
 public class RollingAppenderDeleteScriptFri13thTest {
 
     private static final String CONFIG = 
"log4j-rolling-with-custom-delete-script-fri13th.xml";
@@ -58,6 +58,9 @@ public class RollingAppenderDeleteScriptFri13thTest {
 
     @Test
     public void testAppender() throws Exception {
+        LocalDate now = LocalDate.now();
+        // Ignore on Friday 13th
+        assumeFalse(now.getDayOfWeek() == DayOfWeek.FRIDAY && 
now.getDayOfMonth() == 13);
         final var dir = Path.of(DIR);
         Files.createDirectories(dir);
         for (int i = 1; i <= 30; i++) {

Reply via email to