From e4b739502670bdcd20259a3ca03189971b1eef53 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Wed, 27 Aug 2014 12:11:18 +0200 Subject: [PATCH] [TEST] only bump replicas if we have enough nodes in the cluster --- .../snapshots/SnapshotBackwardsCompatibilityTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/elasticsearch/snapshots/SnapshotBackwardsCompatibilityTest.java b/src/test/java/org/elasticsearch/snapshots/SnapshotBackwardsCompatibilityTest.java index 6ed8e616164..a33778e5b7b 100644 --- a/src/test/java/org/elasticsearch/snapshots/SnapshotBackwardsCompatibilityTest.java +++ b/src/test/java/org/elasticsearch/snapshots/SnapshotBackwardsCompatibilityTest.java @@ -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(); }