activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r799631 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java
Date Fri, 31 Jul 2009 15:06:27 GMT
Author: gtully
Date: Fri Jul 31 15:06:27 2009
New Revision: 799631

URL: http://svn.apache.org/viewvc?rev=799631&view=rev
Log:
more hardening for intermittent failure

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java?rev=799631&r1=799630&r2=799631&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/bugs/DurableConsumerTest.java
Fri Jul 31 15:06:27 2009
@@ -51,6 +51,7 @@
 import org.apache.activemq.store.PersistenceAdapter;
 import org.apache.activemq.store.amq.AMQPersistenceAdapter;
 import org.apache.activemq.store.amq.AMQPersistenceAdapterFactory;
+import org.apache.activemq.util.Wait;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -273,9 +274,14 @@
             }
         }
         
-        Thread.sleep(2000);
         executor.shutdown();
         executor.awaitTermination(30, TimeUnit.SECONDS);
+        
+        Wait.waitFor(new Wait.Condition() {
+            public boolean isSatisified() throws Exception {
+                return receivedCount.get() > numMessages;
+            } 
+        });
         assertTrue("got some messages: " + receivedCount.get(), receivedCount.get() >
numMessages);
         assertTrue("no exceptions, but: " + exceptions, exceptions.isEmpty());
     }



Mime
View raw message