This is an automated email from the ASF dual-hosted git repository.
brusdev pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/main by this push:
new 7791a26 ARTEMIS-3540 Fix
SimpleSymmetricClusterTest.testSimpleRestartClusterConnection add bridge
connection verification after stop cluster connection to wait for the bridge
stop completely and avoid a failure on stop/start cluster connection test
7791a26 is described below
commit 7791a268c8d8b859442b259f78d3552523514d5e
Author: Tiago Bueno <[email protected]>
AuthorDate: Fri Oct 15 15:08:02 2021 +0200
ARTEMIS-3540 Fix
SimpleSymmetricClusterTest.testSimpleRestartClusterConnection
add bridge connection verification after stop cluster connection
to wait for the bridge stop completely and avoid a failure
on stop/start cluster connection test
---
.../cluster/distribution/SimpleSymmetricClusterTest.java | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java
index 6c3454a..4c69112 100644
---
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java
+++
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/SimpleSymmetricClusterTest.java
@@ -16,11 +16,14 @@
*/
package org.apache.activemq.artemis.tests.integration.cluster.distribution;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.postoffice.Binding;
import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
+import org.apache.activemq.artemis.core.server.cluster.MessageFlowRecord;
import org.apache.activemq.artemis.core.server.cluster.RemoteQueueBinding;
import
org.apache.activemq.artemis.core.server.cluster.impl.ClusterConnectionImpl;
import
org.apache.activemq.artemis.core.server.cluster.impl.MessageLoadBalancingType;
@@ -149,10 +152,16 @@ public class SimpleSymmetricClusterTest extends
ClusterTestBase {
ClusterConnection clusterConnection1 =
getServer(1).getClusterManager().getClusterConnection("cluster1");
ClusterConnection clusterConnection2 =
getServer(2).getClusterManager().getClusterConnection("cluster2");
+
Wait.assertEquals(2, () ->
((ClusterConnectionImpl)clusterConnection0).getRecords().size());
Wait.assertEquals(2, () ->
((ClusterConnectionImpl)clusterConnection1).getRecords().size());
Wait.assertEquals(2, () ->
((ClusterConnectionImpl)clusterConnection2).getRecords().size());
+
+ List<MessageFlowRecord> clusterConnectionRecords0 = new
ArrayList<>(((ClusterConnectionImpl) clusterConnection0).getRecords().values());
+ List<MessageFlowRecord> clusterConnectionRecords1 = new
ArrayList<>(((ClusterConnectionImpl) clusterConnection1).getRecords().values());
+ List<MessageFlowRecord> clusterConnectionRecords2 = new
ArrayList<>(((ClusterConnectionImpl) clusterConnection2).getRecords().values());
+
clusterConnection0.stop();
clusterConnection1.stop();
clusterConnection2.stop();
@@ -161,6 +170,10 @@ public class SimpleSymmetricClusterTest extends
ClusterTestBase {
Assert.assertEquals(0,
((ClusterConnectionImpl)clusterConnection1).getRecords().size());
Assert.assertEquals(0,
((ClusterConnectionImpl)clusterConnection2).getRecords().size());
+ Wait.assertTrue(() ->
clusterConnectionRecords0.stream().noneMatch(messageFlowRecord ->
messageFlowRecord.getBridge().isConnected()), 1000);
+ Wait.assertTrue(() ->
clusterConnectionRecords1.stream().noneMatch(messageFlowRecord ->
messageFlowRecord.getBridge().isConnected()), 1000);
+ Wait.assertTrue(() ->
clusterConnectionRecords2.stream().noneMatch(messageFlowRecord ->
messageFlowRecord.getBridge().isConnected()), 1000);
+
clusterConnection0.start();
clusterConnection1.start();
clusterConnection2.start();