activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [3/4] activemq-6 git commit: Improving a test that failed due to what seemed a race
Date Tue, 31 Mar 2015 15:25:01 GMT
Improving a test that failed due to what seemed a race


Project: http://git-wip-us.apache.org/repos/asf/activemq-6/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-6/commit/2f819a63
Tree: http://git-wip-us.apache.org/repos/asf/activemq-6/tree/2f819a63
Diff: http://git-wip-us.apache.org/repos/asf/activemq-6/diff/2f819a63

Branch: refs/heads/master
Commit: 2f819a63e7afa734d096156277358933c3311c45
Parents: 519a47f
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Mon Mar 16 19:17:52 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Mar 31 11:23:06 2015 -0400

----------------------------------------------------------------------
 .../activemq/tests/unit/core/server/impl/QueueImplTest.java | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-6/blob/2f819a63/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/server/impl/QueueImplTest.java
----------------------------------------------------------------------
diff --git a/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/server/impl/QueueImplTest.java
b/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/server/impl/QueueImplTest.java
index 8286ab6..3be1f61 100644
--- a/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/server/impl/QueueImplTest.java
+++ b/tests/unit-tests/src/test/java/org/apache/activemq/tests/unit/core/server/impl/QueueImplTest.java
@@ -625,8 +625,13 @@ public class QueueImplTest extends UnitTestCase
       queue.resume();
 
       // Need to make sure the consumers will receive the messages before we do these assertions
-      long timeout = System.currentTimeMillis() + 1000;
-      while (cons1.getReferences().size() != numMessages / 2 && cons2.getReferences().size()
!= numMessages / 2 && timeout > System.currentTimeMillis())
+      long timeout = System.currentTimeMillis() + 5000;
+      while (cons1.getReferences().size() != numMessages / 2 && timeout > System.currentTimeMillis())
+      {
+         Thread.sleep(1);
+      }
+
+      while (cons2.getReferences().size() != numMessages / 2 && timeout > System.currentTimeMillis())
       {
          Thread.sleep(1);
       }


Mime
View raw message