diff options
author | Martin Ritchie <ritchiem@apache.org> | 2008-01-10 14:41:37 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2008-01-10 14:41:37 +0000 |
commit | c80e0d6037fd3ec7378bc8349d858e80a6107ad3 (patch) | |
tree | 29387706fa5ce790124a5049b897563e04d0de83 | |
parent | d67ac681fcea5188555f0b81c25f6b6edf97b77e (diff) | |
download | qpid-python-c80e0d6037fd3ec7378bc8349d858e80a6107ad3.tar.gz |
QPID-690 : Relaxed the timings on failover as Thread.sleep is accurate to 10ms so may finish the sleep 10ms early. Resulting in erratic failures as 9.9s < 10s.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2@610806 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java b/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java index b346dceef9..2c293527d9 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java +++ b/java/systests/src/main/java/org/apache/qpid/server/failover/FailoverMethodTest.java @@ -78,9 +78,11 @@ public class FailoverMethodTest extends TestCase implements ExceptionListener long end = System.currentTimeMillis(); //Failover should take less that 10 seconds. - // This is calculated by vm://:1 two retries left after initial connection ( 4s) + // This is calculated by vm://:1 two retries left after initial connection (4s) // localhost get three retries so (6s) so 10s in total for connection dropping - assertTrue("Failover took over 10 seconds:"+(end - start), (end - start) > 10000); + assertTrue("Failover took less than 9.5 seconds:"+(end - start), (end - start) > 9500); + // The sleep method is not 100% accurate under windows so with 5 sleeps and a 10ms accuracy then there is + // the potential for the tests to finish in 500ms sooner than the predicted 10s. } catch (AMQException e) @@ -112,7 +114,9 @@ public class FailoverMethodTest extends TestCase implements ExceptionListener // This is calculated by vm://:1 two retries left after initial connection // so 4s in total for connection dropping - assertTrue("Failover took over 4 seconds", (end - start) > 4000); + assertTrue("Failover took less than 3.7 seconds", (end - start) > 3700); + // The sleep method is not 100% accurate under windows so with 3 sleeps and a 10ms accuracy then there is + // the potential for the tests to finish in 300ms sooner than the predicted 4s. } catch (AMQException e) |