This closes #2021
This commit is contained in:
commit
90b9a9809a
|
@ -1314,7 +1314,7 @@ public abstract class ActiveMQTestBase extends Assert {
|
||||||
* @param backup
|
* @param backup
|
||||||
*/
|
*/
|
||||||
public static final void waitForRemoteBackupSynchronization(final ActiveMQServer backup) {
|
public static final void waitForRemoteBackupSynchronization(final ActiveMQServer backup) {
|
||||||
waitForRemoteBackup(null, 10, true, backup);
|
waitForRemoteBackup(null, 20, true, backup);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1332,6 +1332,10 @@ public abstract class ActiveMQTestBase extends Assert {
|
||||||
final long toWait = seconds * 1000;
|
final long toWait = seconds * 1000;
|
||||||
final long time = System.currentTimeMillis();
|
final long time = System.currentTimeMillis();
|
||||||
int loop = 0;
|
int loop = 0;
|
||||||
|
//Note: if maxLoop is too small there won't be
|
||||||
|
//enough time for quorum vote to complete and
|
||||||
|
//will cause test to fail.
|
||||||
|
final int maxLoop = 40;
|
||||||
while (true) {
|
while (true) {
|
||||||
Activation activation = actualServer.getActivation();
|
Activation activation = actualServer.getActivation();
|
||||||
boolean isReplicated = !backup.getHAPolicy().isSharedStore();
|
boolean isReplicated = !backup.getHAPolicy().isSharedStore();
|
||||||
|
@ -1343,7 +1347,7 @@ public abstract class ActiveMQTestBase extends Assert {
|
||||||
//we may have already failed over and changed the Activation
|
//we may have already failed over and changed the Activation
|
||||||
if (actualServer.isStarted()) {
|
if (actualServer.isStarted()) {
|
||||||
//let it fail a few time to have time to start stopping in the case of waiting to failback
|
//let it fail a few time to have time to start stopping in the case of waiting to failback
|
||||||
isRemoteUpToDate = loop++ > 10;
|
isRemoteUpToDate = loop++ > maxLoop;
|
||||||
} else {
|
} else {
|
||||||
//we could be waiting to failback or restart if the server is stopping
|
//we could be waiting to failback or restart if the server is stopping
|
||||||
isRemoteUpToDate = false;
|
isRemoteUpToDate = false;
|
||||||
|
|
|
@ -43,6 +43,11 @@ public class QuorumFailOverTest extends StaticClusterWithBackupFailoverTest {
|
||||||
((ReplicaPolicyConfiguration) servers[3].getConfiguration().getHAPolicyConfiguration()).setGroupName("group0");
|
((ReplicaPolicyConfiguration) servers[3].getConfiguration().getHAPolicyConfiguration()).setGroupName("group0");
|
||||||
((ReplicaPolicyConfiguration) servers[4].getConfiguration().getHAPolicyConfiguration()).setGroupName("group1");
|
((ReplicaPolicyConfiguration) servers[4].getConfiguration().getHAPolicyConfiguration()).setGroupName("group1");
|
||||||
((ReplicaPolicyConfiguration) servers[5].getConfiguration().getHAPolicyConfiguration()).setGroupName("group2");
|
((ReplicaPolicyConfiguration) servers[5].getConfiguration().getHAPolicyConfiguration()).setGroupName("group2");
|
||||||
|
|
||||||
|
//reduce the numbers so that the vote finishes faster
|
||||||
|
((ReplicaPolicyConfiguration) servers[3].getConfiguration().getHAPolicyConfiguration()).setVoteRetries(5);
|
||||||
|
((ReplicaPolicyConfiguration) servers[3].getConfiguration().getHAPolicyConfiguration()).setVoteRetryWait(500);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue