diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-06-07 20:55:38 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-06-07 20:55:38 +0000 |
| commit | d507154be94ec0ac45e796e26a6c913369052c74 (patch) | |
| tree | 413eb094ea9ccb4be844df173ee863e7035aeaf4 /qpid/java | |
| parent | cb1c07dbe377e5db9ac859b213d00860017352ba (diff) | |
| download | qpid-python-d507154be94ec0ac45e796e26a6c913369052c74.tar.gz | |
For testOderingWithSyncConsumer I added a timeout for the individual receive() methods, and another timeout for the while loop to prevent the test from hanging in case of an error.
For testOderingWithAsyncConsumer I increased the timeout to 8 secs as there have been occasional failures with the test not being completed inside 5 secs.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@952430 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java index a3dd7e4a99..5e7ba5482d 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java @@ -339,10 +339,18 @@ public class RecoverTest extends FailoverBaseCase int messageSeen = 0; int expectedMsg = 0; - // need to add a timer here as well. + long startTime = System.currentTimeMillis(); + while(expectedMsg < 8) { - Message message = cons.receive(); + // Based on historical data, on average the test takes about 6 secs to complete. + if (System.currentTimeMillis() - startTime > 8000) + { + fail("Test did not complete on time. Received " + + expectedMsg + " msgs so far. Please check the logs"); + } + + Message message = cons.receive(2000); String text=((TextMessage) message).getText(); assertEquals("Received Message Out Of Order","Msg"+expectedMsg,text); @@ -430,7 +438,8 @@ public class RecoverTest extends FailoverBaseCase synchronized(lock) { - lock.wait(5000); + // Based on historical data, on average the test takes about 6 secs to complete. + lock.wait(8000); } if (!pass.get()) |
