diff --git a/server/src/test/java/org/elasticsearch/cluster/coordination/RareClusterStateIT.java b/server/src/test/java/org/elasticsearch/cluster/coordination/RareClusterStateIT.java index 687095886d4..cb5213ee99e 100644 --- a/server/src/test/java/org/elasticsearch/cluster/coordination/RareClusterStateIT.java +++ b/server/src/test/java/org/elasticsearch/cluster/coordination/RareClusterStateIT.java @@ -51,6 +51,7 @@ import org.elasticsearch.indices.IndicesService; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.disruption.BlockClusterStateProcessing; import org.elasticsearch.test.junit.annotations.TestLogging; +import org.elasticsearch.transport.TransportSettings; import java.util.List; import java.util.Map; @@ -81,7 +82,7 @@ public class RareClusterStateIT extends ESIntegTestCase { } public void testAssignmentWithJustAddedNodes() { - internalCluster().startNode(); + internalCluster().startNode(Settings.builder().put(TransportSettings.CONNECT_TIMEOUT.getKey(), "1s")); final String index = "index"; prepareCreate(index).setSettings(Settings.builder().put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1) .put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 0)).get(); @@ -90,13 +91,12 @@ public class RareClusterStateIT extends ESIntegTestCase { // close to have some unassigned started shards shards.. client().admin().indices().prepareClose(index).get(); - final String masterName = internalCluster().getMasterName(); final ClusterService clusterService = internalCluster().clusterService(masterName); final AllocationService allocationService = internalCluster().getInstance(AllocationService.class, masterName); clusterService.submitStateUpdateTask("test-inject-node-and-reroute", new ClusterStateUpdateTask() { @Override - public ClusterState execute(ClusterState currentState) throws Exception { + public ClusterState execute(ClusterState currentState) { // inject a node ClusterState.Builder builder = ClusterState.builder(currentState); builder.nodes(DiscoveryNodes.builder(currentState.nodes()).add(new DiscoveryNode("_non_existent", @@ -115,12 +115,10 @@ public class RareClusterStateIT extends ESIntegTestCase { updatedState = ClusterState.builder(updatedState).routingTable(routingTable.build()).build(); return allocationService.reroute(updatedState, "reroute"); - } @Override public void onFailure(String source, Exception e) { - } }); ensureGreen(index); @@ -133,12 +131,10 @@ public class RareClusterStateIT extends ESIntegTestCase { currentState = builder.build(); return allocationService.disassociateDeadNodes(currentState, true, "reroute"); - } @Override public void onFailure(String source, Exception e) { - } }); }