You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2017/05/03 20:41:50 UTC

[2/2] activemq-artemis git commit: ARTEMIS-1140: Trivial test fix

ARTEMIS-1140: Trivial test fix

(cherry picked from commit 0146109d6a06f9702f245034a43c49dffc5779bd)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/468b8a95
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/468b8a95
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/468b8a95

Branch: refs/heads/1.x
Commit: 468b8a954bb4d2a163908fb8edb7a284b7b32b86
Parents: 534fd80
Author: Clebert Suconic <cl...@apache.org>
Authored: Wed May 3 16:12:01 2017 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed May 3 16:41:42 2017 -0400

----------------------------------------------------------------------
 .../artemis/jms/tests/ActiveMQServerTestCase.java         | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/468b8a95/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java
----------------------------------------------------------------------
diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java
index 42d6ea5..c65f0cd 100644
--- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java
+++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java
@@ -371,7 +371,15 @@ public abstract class ActiveMQServerTestCase {
       if (binding != null && binding instanceof LocalQueueBinding) {
          ((LocalQueueBinding) binding).getQueue().flushExecutor();
       }
-      Long messageCount = ActiveMQServerTestCase.servers.get(0).getMessageCountForQueue(queueName);
+      Long messageCount = null;
+      for (int i = 0; i < 10; i++) {
+         messageCount = servers.get(0).getMessageCountForQueue(queueName);
+         if (messageCount.longValue() == expected) {
+            break;
+         } else {
+            Thread.sleep(100);
+         }
+      }
 
       ProxyAssertSupport.assertEquals(expected, messageCount.intValue());
       return expected == messageCount.intValue();