activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/2] activemq-artemis git commit: Make ScaleDownTest#testStoreAndForward more robust
Date Mon, 09 May 2016 18:33:04 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 784652160 -> 8e7f87684


Make ScaleDownTest#testStoreAndForward more robust


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

Branch: refs/heads/master
Commit: 9794ac769be277a214eaf8441eec199bcc4903a1
Parents: 7846521
Author: jbertram <jbertram@apache.org>
Authored: Fri May 6 13:25:59 2016 -0500
Committer: jbertram <jbertram@apache.org>
Committed: Fri May 6 13:25:59 2016 -0500

----------------------------------------------------------------------
 .../tests/integration/server/ScaleDownTest.java | 29 ++++++++++++++++++--
 1 file changed, 26 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/9794ac76/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
index db2a907..dfc252f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDownTest.java
@@ -181,10 +181,33 @@ public class ScaleDownTest extends ClusterTestBase {
       addConsumer(0, 1, queueName1, null);
       addConsumer(1, 1, queueName2, null);
 
+      LocalQueueBinding queue1Binding = ((LocalQueueBinding) servers[0].getPostOffice().getBinding(new
SimpleString(queueName1)));
+      LocalQueueBinding queue2Binding = ((LocalQueueBinding) servers[0].getPostOffice().getBinding(new
SimpleString(queueName2)));
+      LocalQueueBinding sfQueueBinding = ((LocalQueueBinding) servers[0].getPostOffice().getBinding(new
SimpleString(sfQueueName)));
+
+      long timeout = 5000;
+      long start = System.currentTimeMillis();
+
+      while (getMessageCount(queue1Binding.getQueue()) > 0 && System.currentTimeMillis()
- start <= timeout) {
+         Thread.sleep(50);
+      }
+
+      start = System.currentTimeMillis();
+
+      while (getMessageCount(queue2Binding.getQueue()) > 0 && System.currentTimeMillis()
- start <= timeout) {
+         Thread.sleep(50);
+      }
+
+      start = System.currentTimeMillis();
+
+      while (getMessageCount(sfQueueBinding.getQueue()) < TEST_SIZE * 2 && System.currentTimeMillis()
- start <= timeout) {
+         Thread.sleep(50);
+      }
+
       // at this point on node 0 there should be 0 messages in test queues and TEST_SIZE
* 2 messages in the sf queue
-      Assert.assertEquals(0, getMessageCount(((LocalQueueBinding) servers[0].getPostOffice().getBinding(new
SimpleString(queueName1))).getQueue()));
-      Assert.assertEquals(0, getMessageCount(((LocalQueueBinding) servers[0].getPostOffice().getBinding(new
SimpleString(queueName2))).getQueue()));
-      Assert.assertEquals(TEST_SIZE * 2, getMessageCount(((LocalQueueBinding) servers[0].getPostOffice().getBinding(new
SimpleString(sfQueueName))).getQueue()));
+      Assert.assertEquals(0, getMessageCount(queue1Binding.getQueue()));
+      Assert.assertEquals(0, getMessageCount(queue2Binding.getQueue()));
+      Assert.assertEquals(TEST_SIZE * 2, getMessageCount(sfQueueBinding.getQueue()));
 
       removeConsumer(0);
       removeConsumer(1);


Mime
View raw message