diff --git a/core/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsIT.java b/core/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsIT.java index 99a7f04e74d..9a54419bc5c 100644 --- a/core/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsIT.java +++ b/core/src/test/java/org/elasticsearch/discovery/DiscoveryWithServiceDisruptionsIT.java @@ -1213,7 +1213,7 @@ public class DiscoveryWithServiceDisruptionsIT extends ESIntegTestCase { for (String node : nodes) { assertNoMaster(node); } - isolateAllNodes.stopDisrupting(); + internalCluster().clearDisruptionScheme(); ensureStableCluster(3); final String preferredMasterName = internalCluster().getMasterName(); final DiscoveryNode preferredMaster = internalCluster().clusterService(preferredMasterName).localNode(); diff --git a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java index 2321690bee9..2c89e2924c1 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java @@ -1756,7 +1756,8 @@ public final class InternalTestCluster extends TestCluster { public void setDisruptionScheme(ServiceDisruptionScheme scheme) { - clearDisruptionScheme(); + assert activeDisruptionScheme == null : + "there is already and active disruption [" + activeDisruptionScheme + "]. call clearDisruptionScheme first"; scheme.applyToCluster(this); activeDisruptionScheme = scheme; }