ARTEMIS-2709: Fix LiveToLiveFailoverTest::scaleDownDelay

Test fails with the primary server being killed by the crash and the backup server is killed
by the tearDown before ScaleDownHandler can kick in. This commit adds a wait method to allow
ScaleDownHandler to process before the test completes.
This commit is contained in:
Atri Sharma 2020-05-11 22:42:09 +05:30 committed by Clebert Suconic
parent 9f9c8f6a36
commit 35e1d4e679
1 changed files with 7 additions and 1 deletions

View File

@ -32,8 +32,10 @@ import org.apache.activemq.artemis.core.config.ha.ColocatedPolicyConfiguration;
import org.apache.activemq.artemis.core.config.ha.SharedStoreMasterPolicyConfiguration;
import org.apache.activemq.artemis.core.config.ha.SharedStoreSlavePolicyConfiguration;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.core.server.impl.InVMNodeManager;
import org.apache.activemq.artemis.tests.util.TransportConfigurationUtils;
import org.apache.activemq.artemis.tests.util.Wait;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
@ -191,7 +193,6 @@ public class LiveToLiveFailoverTest extends FailoverTest {
* Ignoring the test for now until we can fix it.
* @throws Exception
*/
@Ignore
@Test
public void scaleDownDelay() throws Exception {
createSessionFactory();
@ -207,6 +208,11 @@ public class LiveToLiveFailoverTest extends FailoverTest {
crash(session);
// Wait for failover to happen
Queue serverQueue = backupServer.getServer().locateQueue(ADDRESS);
Wait.assertEquals(1000, serverQueue::getMessageCount);
ClientConsumer consumer = session.createConsumer(ADDRESS);
session.start();