Author: markt Date: Mon Aug 15 13:14:12 2011 New Revision: 1157834 URL: http://svn.apache.org/viewvc?rev=1157834&view=rev Log: Better fix for timing issues on Linux with unit tests
Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java Modified: tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java?rev=1157834&r1=1157833&r2=1157834&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java (original) +++ tomcat/trunk/test/org/apache/catalina/core/TestStandardContextValve.java Mon Aug 15 13:14:12 2011 @@ -70,8 +70,16 @@ public class TestStandardContextValve ex int rc = getUrl("http://localhost:" + getPort() + "/invalid", new ByteChunk(), null); - tomcat.stop(); - tomcat.destroy(); + // 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()); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org