This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit b0a74d7e589400932d6f43042b485796bc4328bb
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Sun Mar 13 21:57:02 2022 +0100

    FileAppenderTest: increase thread pool termination timeout
    
    The thread pool termination timeout on MacOS might be too short.
    # Conflicts:
    #   
log4j-core/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java
---
 .../apache/logging/log4j/core/appender/FileAppenderTest.java   | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git 
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java
 
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java
index b2667be..bb1d821 100644
--- 
a/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java
+++ 
b/log4j-core-test/src/test/java/org/apache/logging/log4j/core/appender/FileAppenderTest.java
@@ -173,11 +173,17 @@ public class FileAppenderTest {
             threadPool.execute(runnable);
         }
         threadPool.shutdown();
-        assertTrue(
-                threadPool.awaitTermination(10, TimeUnit.SECONDS), "The thread 
pool has not shutdown: " + threadPool);
+        boolean stopped = false;
+        for (int i = 0; i < 20; i++) {
+            // intentional assignment
+            if (stopped = threadPool.awaitTermination(1, TimeUnit.SECONDS)) {
+                break;
+            }
+        }
         if (throwableRef.get() != null) {
             Throwables.rethrow(throwableRef.get());
         }
+        assertTrue(stopped, "The thread pool has not shutdown: " + threadPool);
         verifyFile(threadCount * logEventCount);
     }
 

Reply via email to