summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2010-06-07 20:55:38 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2010-06-07 20:55:38 +0000
commitd01fcb66243a50af2a3df7a8967023dbb66fc579 (patch)
tree905b43de8c158e6781c1f3c593a17480d8fa1d59
parent7190e9450f604b5f5738f8adf4c601c6c953add5 (diff)
downloadqpid-python-d01fcb66243a50af2a3df7a8967023dbb66fc579.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/qpid@952430 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java
index a3dd7e4a99..5e7ba5482d 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java
+++ b/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())