diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java index e131d1c95fe..416df107e15 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java @@ -107,8 +107,15 @@ public class ChaosMonkeyNothingIsSafeTest extends AbstractFullDistribZkTestBase public ChaosMonkeyNothingIsSafeTest() { super(); - sliceCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.slicecount", "2")); - shardCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.shardcount", "7")); + sliceCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.slicecount", "-1")); + shardCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.shardcount", "-1")); + + if (sliceCount == -1) { + sliceCount = random().nextInt(TEST_NIGHTLY ? 5 : 3) + 1; + } + if (shardCount == -1) { + shardCount = sliceCount + random().nextInt(TEST_NIGHTLY ? 12 : 2); + } } @Override 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 33bc4b6b3dc..f2bcc68f10f 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java @@ -20,7 +20,6 @@ package org.apache.solr.cloud; import java.util.ArrayList; import java.util.List; -import org.apache.lucene.util.LuceneTestCase.BadApple; import org.apache.lucene.util.LuceneTestCase.Slow; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.impl.CloudSolrServer; @@ -88,8 +87,15 @@ public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase { public ChaosMonkeySafeLeaderTest() { super(); - sliceCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.slicecount", "3")); - shardCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.shardcount", "12")); + sliceCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.slicecount", "-1")); + shardCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.shardcount", "-1")); + + if (sliceCount == -1) { + sliceCount = random().nextInt(TEST_NIGHTLY ? 5 : 3) + 1; + } + if (shardCount == -1) { + shardCount = sliceCount + random().nextInt(TEST_NIGHTLY ? 12 : 2); + } } @Override