You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2010/06/07 22:55:38 UTC

svn commit: r952430 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java

Author: rajith
Date: Mon Jun  7 20:55:38 2010
New Revision: 952430

URL: http://svn.apache.org/viewvc?rev=952430&view=rev
Log:
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.

Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java?rev=952430&r1=952429&r2=952430&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/ack/RecoverTest.java Mon Jun  7 20:55:38 2010
@@ -339,10 +339,18 @@ public class RecoverTest extends Failove
         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 Failove
         
         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())



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org