From 4b78cabe4ef7eb16ef7a15c96470d289d23fc8a2 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 23 Jan 2024 10:43:56 -0500 Subject: [PATCH] NO-JIRA Making ClusteredLargeMessageTest more reliable This is waiting and asserting the topology size before starting the test methods. --- .../ClusteredLargeMessageTest.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/clusteredLargeMessage/ClusteredLargeMessageTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/clusteredLargeMessage/ClusteredLargeMessageTest.java index e70ce6a2a57..0aa330d5b19 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/clusteredLargeMessage/ClusteredLargeMessageTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/clusteredLargeMessage/ClusteredLargeMessageTest.java @@ -27,8 +27,11 @@ import java.io.File; +import org.apache.activemq.artemis.api.core.management.SimpleManagement; import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase; import org.apache.activemq.artemis.tests.util.CFUtil; +import org.apache.activemq.artemis.util.ServerUtil; +import org.apache.activemq.artemis.utils.Wait; import org.apache.activemq.artemis.utils.cli.helper.HelperCreate; import org.junit.Assert; import org.junit.Before; @@ -73,8 +76,17 @@ public static void createServers() throws Exception { public void before() throws Exception { cleanupData(SERVER_NAME_0); cleanupData(SERVER_NAME_1); - server0Process = startServer(SERVER_NAME_0, 0, 30000); - server1Process = startServer(SERVER_NAME_1, 100, 30000); + server0Process = startServer(SERVER_NAME_0, 0, 0); + server1Process = startServer(SERVER_NAME_1, 0, 0); + + ServerUtil.waitForServerToStart(0, null, null, 30000); + ServerUtil.waitForServerToStart(100, null, null, 30000); + + SimpleManagement simpleManagement61616 = new SimpleManagement("tcp://localhost:61616", null, null); + Wait.assertEquals(2, () -> simpleManagement61616.listNetworkTopology().size()); + SimpleManagement simpleManagement61716 = new SimpleManagement("tcp://localhost:61716", null, null); + Wait.assertEquals(2, () -> simpleManagement61716.listNetworkTopology().size()); + } @Test