activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [3/3] activemq-artemis git commit: NO-JIRA fix race in cluster test
Date Thu, 23 Mar 2017 03:32:46 GMT
NO-JIRA fix race in cluster test


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

Branch: refs/heads/master
Commit: bf4d7767afd582d7a83bd85fc11da4df6580b367
Parents: 784db37
Author: Justin Bertram <jbertram@apache.org>
Authored: Wed Mar 22 09:45:44 2017 -0500
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Mar 22 23:32:37 2017 -0400

----------------------------------------------------------------------
 .../cluster/topology/TopologyClusterTestBase.java       | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/bf4d7767/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
index a1b76cf..82bdf32 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/topology/TopologyClusterTestBase.java
@@ -41,6 +41,7 @@ import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
 import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
 import org.apache.activemq.artemis.tests.integration.cluster.distribution.ClusterTestBase;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.util.Wait;
 import org.apache.activemq.artemis.utils.RandomUtil;
 import org.junit.Assert;
 import org.junit.Before;
@@ -352,15 +353,8 @@ public abstract class TopologyClusterTestBase extends ClusterTestBase
{
       }
       Assert.assertEquals(ActiveMQTestBase.CLUSTER_PASSWORD, config.getClusterPassword());
       config.setClusterPassword(config.getClusterPassword() + "-1-2-3-");
-      startServers(0, 1, 2, 4, 3);
-      int n = 0;
-      while (n++ < 10) {
-         if (!servers[4].getClusterManager().isStarted()) {
-            break;
-         }
-         Thread.sleep(100);
-      }
-      Assert.assertFalse("cluster manager should stop", servers[4].getClusterManager().isStarted());
+      startServers(0, 4);
+      Assert.assertTrue("one or the other cluster managers should stop", Wait.waitFor(()
-> !servers[4].getClusterManager().isStarted() || !servers[0].getClusterManager().isStarted(),
5000));
       final String address = "foo1235";
       ServerLocator locator = createNonHALocator(isNetty());
       ClientSessionFactory sf = createSessionFactory(locator);


Mime
View raw message