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

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 4d6f883fa4 Make test more robust (CI failure observed for 8.5.x)
4d6f883fa4 is described below

commit 4d6f883fa47f32397686551c99e936a75536904a
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Sep 5 13:52:37 2022 +0100

    Make test more robust (CI failure observed for 8.5.x)
---
 test/org/apache/juli/TestAsyncFileHandlerOverflow.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/test/org/apache/juli/TestAsyncFileHandlerOverflow.java 
b/test/org/apache/juli/TestAsyncFileHandlerOverflow.java
index 73bc7c65dd..f646a90c13 100644
--- a/test/org/apache/juli/TestAsyncFileHandlerOverflow.java
+++ b/test/org/apache/juli/TestAsyncFileHandlerOverflow.java
@@ -107,8 +107,16 @@ public class TestAsyncFileHandlerOverflow {
 
             @Override
             public void rejectedExecution(Runnable r, ThreadPoolExecutor 
executor) {
-                latch.countDown();
+                // Generally, the latch needs to be released after the
+                // RejectedExecutionHandler has completed but for the flush 
case
+                // the latch needs to be released first (else the test loops)
+                if (overflowDropType == AsyncFileHandler.OVERFLOW_DROP_FLUSH) {
+                    latch.countDown();
+                }
                 rejectionHandler.rejectedExecution(r, executor);
+                if (overflowDropType != AsyncFileHandler.OVERFLOW_DROP_FLUSH) {
+                    latch.countDown();
+                }
             }
         });
         this.handler = new AsyncFileHandler(logsDir.toString(), PREFIX, 
SUFFIX, 1, loggerService);


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to