From 6391f90616cca5338f5a77b076df05297562de4d Mon Sep 17 00:00:00 2001 From: Andrey Ershov Date: Tue, 4 Jun 2019 17:22:33 +0200 Subject: [PATCH] Fix testNoMasterActionsWriteMasterBlock (#42798) 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. Closes #39688 (cherry picked from commit c8988d5cf5a85f9b28ce148dbf100aaa6682a757) --- .../test/java/org/elasticsearch/cluster/NoMasterNodeIT.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java b/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java index 78b1fef91f2..450aee482d7 100644 --- a/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java +++ b/server/src/test/java/org/elasticsearch/cluster/NoMasterNodeIT.java @@ -192,7 +192,6 @@ public class NoMasterNodeIT extends ESIntegTestCase { } } - @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/39688") public void testNoMasterActionsWriteMasterBlock() throws Exception { Settings settings = Settings.builder() .put(AutoCreateIndex.AUTO_CREATE_INDEX_SETTING.getKey(), false) @@ -264,8 +263,6 @@ public class NoMasterNodeIT extends ESIntegTestCase { assertThat(e.status(), equalTo(RestStatus.SERVICE_UNAVAILABLE)); } - disruptionScheme.stopDisrupting(); - - client().admin().cluster().prepareHealth().setWaitForGreenStatus().setWaitForNodes("3").get(); + internalCluster().clearDisruptionScheme(true); } }