[TEST] Move rebalance setting to the index level / pass it on index creation

This commit is contained in:
Simon Willnauer 2014-10-29 09:24:35 +01:00
parent b23e6e0593
commit e3a09e1933
1 changed files with 7 additions and 9 deletions

View File

@ -346,18 +346,17 @@ public class SimpleRecoveryLocalGatewayTests extends ElasticsearchIntegrationTes
@Test
@Slow
public void testReusePeerRecovery() throws Exception {
ImmutableSettings.Builder settings = settingsBuilder()
final Settings settings = settingsBuilder()
.put("action.admin.cluster.node.shutdown.delay", "10ms")
.put(MockFSDirectoryService.CHECK_INDEX_ON_CLOSE, false)
.put("gateway.recover_after_nodes", 4)
.put(MockDirectoryHelper.CRASH_INDEX, false)
// prevent any rebalance actions during the peer recovery
// if we run into a relocation the reuse count will be 0 and this fails the test. We are testing here if
// we reuse the files on disk after full restarts for replicas.
.put(EnableAllocationDecider.INDEX_ROUTING_REBALANCE_ENABLE, EnableAllocationDecider.Rebalance.NONE);
internalCluster().startNodesAsync(4, settings.build()).get();
.put(MockDirectoryHelper.CRASH_INDEX, false).build();
internalCluster().startNodesAsync(4, settings).get();
// prevent any rebalance actions during the peer recovery
// if we run into a relocation the reuse count will be 0 and this fails the test. We are testing here if
// we reuse the files on disk after full restarts for replicas.
assertAcked(prepareCreate("test").setSettings(ImmutableSettings.builder().put(indexSettings()).put(EnableAllocationDecider.INDEX_ROUTING_REBALANCE_ENABLE, EnableAllocationDecider.Rebalance.NONE)));
logger.info("--> indexing docs");
for (int i = 0; i < 1000; i++) {
client().prepareIndex("test", "type").setSource("field", "value").execute().actionGet();
@ -381,7 +380,6 @@ public class SimpleRecoveryLocalGatewayTests extends ElasticsearchIntegrationTes
logger.info("Running Cluster Health");
ensureGreen();
logger.info("--> shutting down the nodes");
// Disable allocations while we are closing nodes
client().admin().cluster().prepareUpdateSettings()