NO-JIRA Making ClusteredLargeMessageTest more reliable

This is waiting and asserting the topology size before starting the test methods.
This commit is contained in:
Clebert Suconic 2024-01-23 10:43:56 -05:00
parent 44ceeff63c
commit 4b78cabe4e
1 changed files with 14 additions and 2 deletions

View File

@ -27,8 +27,11 @@ import javax.jms.TextMessage;
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 class ClusteredLargeMessageTest extends SmokeTestBase {
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