You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/09/05 12:53:06 UTC

[tomcat] branch 9.0.x updated: Make test more robust (CI failure observed for 8.5.x)

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

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


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

commit 94aa3fca0cb21010dc3a24bfc7df98401c2ade0a
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 48874b457b..a7d2435a3f 100644
--- a/test/org/apache/juli/TestAsyncFileHandlerOverflow.java
+++ b/test/org/apache/juli/TestAsyncFileHandlerOverflow.java
@@ -105,8 +105,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, Integer.valueOf(1), loggerService);


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