Also seeing similar failures with NIO & APR
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 15 Aug 2011 13:52:18 +0000 (13:52 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 15 Aug 2011 13:52:18 +0000 (13:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1157847 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/core/TestStandardContextValve.java

index 78bb508..87fb50f 100644 (file)
@@ -121,6 +121,17 @@ public class TestStandardContextValve extends TomcatBaseTest {
         int rc = getUrl("http://localhost:" + getPort() + "/test",
                 new ByteChunk(), null);
 
+        // Need to allow time (but not too long in case the test fails) for
+        // ServletRequestListener to complete
+        int i = 20;
+        while (i > 0) {
+            if (trace.toString().endsWith("Destroy")) {
+                break;
+            }
+            Thread.sleep(250);
+            i--;
+        }
+
         assertEquals(Response.SC_NOT_FOUND, rc);
         assertEquals("InitErrorDestroy", trace.toString());
     }