From cd1ed662f847a0055ede7dfbd325e214ec4d1490 Mon Sep 17 00:00:00 2001 From: Andrey Ershov Date: Mon, 24 Jun 2019 18:52:49 +0300 Subject: [PATCH] Fix testNoMasterActions (#43471) This commit performs the proper restore of network disruption. Previously disruptionScheme.stopDisrupting() was called that does not ensure that connectivity between cluster nodes is restored. The test was checking that the cluster has green status, but it was not checking that connectivity between nodes is restored. Here we switch to internalCluster().clearDisruptionScheme(true) which performs both checks before returning. Similar to #42798 Closes #42051 --- .../test/java/org/elasticsearch/cluster/NoMasterNodeIT.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java b/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java index 450aee482d724..1555e9fd4cfd2 100644 --- a/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java +++ b/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java @@ -163,9 +163,7 @@ public void testNoMasterActions() throws Exception { bulkRequestBuilder.setTimeout(timeout); checkWriteAction(bulkRequestBuilder); - disruptionScheme.stopDisrupting(); - - client().admin().cluster().prepareHealth().setWaitForGreenStatus().setWaitForNodes("3").execute().actionGet(); + internalCluster().clearDisruptionScheme(true); } void checkUpdateAction(boolean autoCreateIndex, TimeValue timeout, ActionRequestBuilder builder) {