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 ac87406b10 Try and fix CI failures
ac87406b10 is described below

commit ac87406b10404b927ae5442e3d7b922edd858ca3
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Dec 2 12:02:40 2024 +0000

    Try and fix CI failures
---
 .../catalina/valves/TestJDBCAccessLogValve.java       | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/test/org/apache/catalina/valves/TestJDBCAccessLogValve.java 
b/test/org/apache/catalina/valves/TestJDBCAccessLogValve.java
index acca447510..99c039c4d0 100644
--- a/test/org/apache/catalina/valves/TestJDBCAccessLogValve.java
+++ b/test/org/apache/catalina/valves/TestJDBCAccessLogValve.java
@@ -107,6 +107,25 @@ public class TestJDBCAccessLogValve extends TomcatBaseTest 
{
         }
 
         public void verify() throws Exception {
+            /*
+             * The access log is written after the response. The client may 
have processed the response faster than the
+             * server was able to write the access log. Give the server up to 
5 seconds to write the access log.
+             */
+            int rowCount = 0;
+            int timerCount = 0;
+            while (timerCount < 500) {
+                try (Statement statement = conn.createStatement()) {
+                    statement.execute("SELECT COUNT(*) FROM access");
+                    ResultSet rs = statement.getResultSet();
+                    Assert.assertTrue(rs.next());
+                    rowCount = rs.getInt(1);
+                    if (rowCount > 1) {
+                        break;
+                    }
+                    Thread.sleep(10);
+                    timerCount++;
+                }
+            }
             try (Statement statement = conn.createStatement()) {
                 statement.execute("SELECT * FROM access");
                 ResultSet rs = statement.getResultSet();


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

Reply via email to