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

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


The following commit(s) were added to refs/heads/main by this push:
     new 1f0d5cb018 Additional debug logging for intermittent test failure
1f0d5cb018 is described below

commit 1f0d5cb01892442cb68f067a74093c988ecbc48e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Aug 8 17:39:45 2023 +0100

    Additional debug logging for intermittent test failure
---
 test/org/apache/catalina/core/TestAsyncContextImpl.java | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/test/org/apache/catalina/core/TestAsyncContextImpl.java 
b/test/org/apache/catalina/core/TestAsyncContextImpl.java
index 79c22f3b7e..8158b4bca7 100644
--- a/test/org/apache/catalina/core/TestAsyncContextImpl.java
+++ b/test/org/apache/catalina/core/TestAsyncContextImpl.java
@@ -123,7 +123,12 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
             counter++;
         }
 
-        Assert.assertEquals("1false2true3true4true5false", 
servlet.getResult());
+        String result = servlet.getResult();
+        Assert.assertTrue(result.startsWith("1false2true3true4true5"));
+
+        result = result.substring(22);
+        // Should be "false" (or possibly "") at this point. Must not be 
"true".
+        Assert.assertNotEquals("true", servlet.getResult());
 
         // Check the access log
         alv.validateAccessLog(1, 200, Bug49528Servlet.THREAD_SLEEP_TIME,
@@ -303,6 +308,10 @@ public class TestAsyncContextImpl extends TomcatBaseTest {
                             result.append(req.isAsyncStarted());
                         } catch (NullPointerException npe) {
                             result.append("false");
+                        } catch (Throwable t) {
+                            // Additional debugging for intermittent test 
failure
+                            result.append(t.getClass().getName());
+                            t.printStackTrace();
                         }
                         done = true;
                     } catch (InterruptedException | IOException e) {


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

Reply via email to