Author: markt
Date: Tue Feb 12 13:53:32 2013
New Revision: 1445170

URL: http://svn.apache.org/r1445170
Log:
Add a reasonable error margin to the test.

Modified:
    tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java

Modified: 
tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java?rev=1445170&r1=1445169&r2=1445170&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java 
(original)
+++ tomcat/trunk/test/org/apache/tomcat/websocket/TestWsWebSocketContainer.java 
Tue Feb 12 13:53:32 2013
@@ -59,6 +59,7 @@ public class TestWsWebSocketContainer ex
     private static final byte[] MESSAGE_BINARY_4K = new byte[4096];
 
     private static final long TIMEOUT_MS = 5 * 1000;
+    private static final long MARGIN = 500;
 
     static {
         StringBuilder sb = new StringBuilder(4096);
@@ -314,10 +315,10 @@ public class TestWsWebSocketContainer ex
         String msg = "Time out was [" + timeout + "] ms";
 
         // Check correct time passed
-        Assert.assertTrue(msg, timeout >= TIMEOUT_MS);
+        Assert.assertTrue(msg, timeout >= TIMEOUT_MS - MARGIN );
 
         // Check the timeout wasn't too long
-        Assert.assertTrue(msg, timeout < TIMEOUT_MS*2);
+        Assert.assertTrue(msg, timeout < TIMEOUT_MS * 2);
 
         if (sr == null) {
             Assert.fail();



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

Reply via email to