[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-commits
Subject:    svn commit: r799631 -
From:       gtully () apache ! org
Date:       2009-07-31 15:06:27
Message-ID: 20090731150628.10CCE2388867 () eris ! apache ! org
[Download RAW message or body]

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/apach \
e/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());
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic