diff --git a/src/test/java/org/elasticsearch/cluster/ack/AckClusterUpdateSettingsTests.java b/src/test/java/org/elasticsearch/cluster/ack/AckClusterUpdateSettingsTests.java index d7b98a73cb2..969987a14b9 100644 --- a/src/test/java/org/elasticsearch/cluster/ack/AckClusterUpdateSettingsTests.java +++ b/src/test/java/org/elasticsearch/cluster/ack/AckClusterUpdateSettingsTests.java @@ -45,11 +45,8 @@ public class AckClusterUpdateSettingsTests extends ElasticsearchIntegrationTest @Override protected Settings nodeSettings(int nodeOrdinal) { - //to test that the acknowledgement mechanism is working we better disable the wait for publish - //otherwise the operation is most likely acknowledged even if it doesn't support ack return ImmutableSettings.builder() .put(super.nodeSettings(nodeOrdinal)) - .put(DiscoverySettings.PUBLISH_TIMEOUT, 0) //make sure that enough concurrent reroutes can happen at the same time //we have a minimum of 2 nodes, and a maximum of 10 shards, thus 5 should be enough .put(ThrottlingAllocationDecider.CLUSTER_ROUTING_ALLOCATION_NODE_CONCURRENT_RECOVERIES, 5) @@ -66,11 +63,21 @@ public class AckClusterUpdateSettingsTests extends ElasticsearchIntegrationTest return 0; } + + private void removePublishTimeout() { + //to test that the acknowledgement mechanism is working we better disable the wait for publish + //otherwise the operation is most likely acknowledged even if it doesn't support ack + assertAcked(client().admin().cluster().prepareUpdateSettings().setTransientSettings(ImmutableSettings.builder().put(DiscoverySettings.PUBLISH_TIMEOUT, "0"))); + } + @Test public void testClusterUpdateSettingsAcknowledgement() { createIndex("test"); ensureGreen(); + // now that the cluster is stable, remove timeout + removePublishTimeout(); + NodesInfoResponse nodesInfo = client().admin().cluster().prepareNodesInfo().get(); String excludedNodeId = null; for (NodeInfo nodeInfo : nodesInfo) { @@ -111,6 +118,9 @@ public class AckClusterUpdateSettingsTests extends ElasticsearchIntegrationTest .put("number_of_replicas", 0)).get(); ensureGreen(); + // now that the cluster is stable, remove timeout + removePublishTimeout(); + NodesInfoResponse nodesInfo = client().admin().cluster().prepareNodesInfo().get(); String excludedNodeId = null; for (NodeInfo nodeInfo : nodesInfo) {