Author: markt Date: Sun Jun 19 17:28:26 2011 New Revision: 1137391 URL: http://svn.apache.org/viewvc?rev=1137391&view=rev Log: Add an additional error margin to avoid false test failures
Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1137391&r1=1137390&r2=1137391&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (original) +++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Sun Jun 19 17:28:26 2011 @@ -49,6 +49,8 @@ public class TestAsyncContextImpl extend private static final long REQUEST_TIME = 500; // Timeout thread (where used) checks for timeout every second private static final long TIMEOUT_MARGIN = 1000; + // Timing tests need a small error margin to prevent failures + private static final long ERROR_MARGIN = 10; // Default timeout for these tests private static final long TIMEOUT = 3000; @@ -1048,8 +1050,10 @@ public class TestAsyncContextImpl extend for (int j = 0; j < count; j++) { Entry entry = entries.get(j); assertEquals(status, entry.getStatus()); - assertTrue(entry.toString(), entry.getTime() >= minTime); - assertTrue(entry.toString(), entry.getTime() < maxTime); + assertTrue(entry.toString(), + entry.getTime() >= minTime - ERROR_MARGIN); + assertTrue(entry.toString(), + entry.getTime() < maxTime + ERROR_MARGIN); } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org