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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
     new f44f24d16c Further robustness changes to address Gump failures
f44f24d16c is described below

commit f44f24d16c0ae7c2f240b6e525cb903dd5c4c940
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Mar 19 04:48:36 2025 +0000

    Further robustness changes to address Gump failures
---
 .../apache/catalina/valves/TestExtendedAccessLogValve.java | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/valves/TestExtendedAccessLogValve.java 
b/test/org/apache/catalina/valves/TestExtendedAccessLogValve.java
index fefc342963..52fca78098 100644
--- a/test/org/apache/catalina/valves/TestExtendedAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestExtendedAccessLogValve.java
@@ -150,7 +150,7 @@ public class TestExtendedAccessLogValve extends 
TomcatBaseTest {
 
         long startWait = System.currentTimeMillis();
         String content = writer.toString();
-        while ("".equals(content) && System.currentTimeMillis() - startWait < 
SLEEP_MAX) {
+        while (countLogLines(content) == 0 && System.currentTimeMillis() - 
startWait < SLEEP_MAX) {
             try {
                 Thread.sleep(SLEEP);
             } catch (InterruptedException ex) {
@@ -163,6 +163,18 @@ public class TestExtendedAccessLogValve extends 
TomcatBaseTest {
     }
 
 
+    private int countLogLines(String content) {
+        int result = 0;
+        String[] lines = content.split("\\r?\\n");
+        for (String line : lines) {
+            if (!line.startsWith("#") && !line.trim().isEmpty()) {
+                result++;
+            }
+        }
+        return result;
+    }
+
+
     private void processLogContent(String content) {
         String[] lines = content.split("\\r?\\n");
 


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

Reply via email to