|
@@ -219,7 +219,11 @@ public class CoordinatorTests extends AbstractCoordinatorTestCase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void testLeaderDisconnectionWithDisconnectEventDetectedQuickly() {
|
|
public void testLeaderDisconnectionWithDisconnectEventDetectedQuickly() {
|
|
|
- try (Cluster cluster = new Cluster(randomIntBetween(3, 5))) {
|
|
|
|
|
|
|
+ testLeaderDisconnectionWithDisconnectEventDetectedQuickly(Settings.EMPTY, TimeValue.ZERO);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ protected void testLeaderDisconnectionWithDisconnectEventDetectedQuickly(Settings settings, TimeValue extraStabilisationTime) {
|
|
|
|
|
+ try (Cluster cluster = new Cluster(randomIntBetween(3, 5), true, settings)) {
|
|
|
cluster.runRandomly();
|
|
cluster.runRandomly();
|
|
|
cluster.stabilise();
|
|
cluster.stabilise();
|
|
|
|
|
|
|
@@ -238,6 +242,8 @@ public class CoordinatorTests extends AbstractCoordinatorTestCase {
|
|
|
+ DEFAULT_CLUSTER_STATE_UPDATE_DELAY
|
|
+ DEFAULT_CLUSTER_STATE_UPDATE_DELAY
|
|
|
// then wait for the followup reconfiguration
|
|
// then wait for the followup reconfiguration
|
|
|
+ DEFAULT_CLUSTER_STATE_UPDATE_DELAY
|
|
+ DEFAULT_CLUSTER_STATE_UPDATE_DELAY
|
|
|
|
|
+ // plus possibly some extra time according to the config
|
|
|
|
|
+ + extraStabilisationTime.millis()
|
|
|
);
|
|
);
|
|
|
assertThat(cluster.getAnyLeader().getId(), not(equalTo(originalLeader.getId())));
|
|
assertThat(cluster.getAnyLeader().getId(), not(equalTo(originalLeader.getId())));
|
|
|
}
|
|
}
|