Apache Solr open-source search software
SOLR-6419: The ChaosMonkey tests should use fewers jetty instances on non nightly runs.
Mark Robert Milleracee95a8d76a
diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.javaindex 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 AbstractFullDistribZkTestBasepublic 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);+ }}@Overridediff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.javaindex 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