[TEST] only bump replicas if we have enough nodes in the cluster

This commit is contained in:
Simon Willnauer 2014-08-27 12:11:18 +02:00
parent 6797d73d7e
commit e4b7395026
1 changed files with 1 additions and 1 deletions

View File

@ -210,7 +210,7 @@ public class SnapshotBackwardsCompatibilityTest extends ElasticsearchBackwardsCo
} while (upgraded);
client().admin().indices().prepareUpdateSettings("test").setSettings(ImmutableSettings.builder().put(EnableAllocationDecider.INDEX_ROUTING_ALLOCATION_ENABLE, "all")).get();
}
if (randomBoolean()) {
if (cluster().numDataNodes() > 1 && randomBoolean()) { // only bump the replicas if we have enough nodes
client().admin().indices().prepareUpdateSettings("test").setSettings(ImmutableSettings.builder().put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, randomIntBetween(1,2))).get();
}