Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 18713 invoked from network); 31 Jul 2009 15:06:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Jul 2009 15:06:51 -0000 Received: (qmail 83502 invoked by uid 500); 31 Jul 2009 15:06:52 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 83453 invoked by uid 500); 31 Jul 2009 15:06:52 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 83444 invoked by uid 99); 31 Jul 2009 15:06:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2009 15:06:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2009 15:06:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 10CCE2388867; Fri, 31 Jul 2009 15:06:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090731150628.10CCE2388867@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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()); }