From 98f75136096aaefa83760fb46eea0128b1152211 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Thu, 5 Feb 2015 06:33:28 +0000 Subject: [PATCH] SOLR-6227: Avoid spurious failures of ChaosMonkeySafeLeaderTest by ensuring there's at least one jetty to kill git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1657487 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ .../test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index ad61abb63b8..0e63ccd0c88 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -882,6 +882,9 @@ Other Changes * SOLR-5918: ant clean does not remove ZooKeeper data (Varun Thacker, Steve Rowe) +* SOLR-6227: Avoid spurious failures of ChaosMonkeySafeLeaderTest by ensuring there's + at least one jetty to kill. (shalin) + ================== 4.10.3 ================== Bug Fixes diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java index 5df3dcb7f87..b7d815cb297 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java @@ -92,7 +92,9 @@ public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase { int numShards = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.shardcount", "-1")); if (numShards == -1) { - numShards = sliceCount + random().nextInt(TEST_NIGHTLY ? 12 : 2); + // we make sure that there's at least one shard with more than one replica + // so that the ChaosMonkey has something to kill + numShards = sliceCount + random().nextInt(TEST_NIGHTLY ? 12 : 2) + 1; } fixShardCount(numShards); }