Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

tests: parameterize

Mark Robert Millera3d1252e7d97
diff --git a/solr/core/src/test-files/solr/solr.xml b/solr/core/src/test-files/solr/solr.xml
index 0123502db7d..ec5062cff17 100644
--- a/solr/core/src/test-files/solr/solr.xml
+++ b/solr/core/src/test-files/solr/solr.xml
@@ -29,7 +29,7 @@
If 'null' (or absent), cores will not be manageable via request handler
-->
<cores adminPath="/admin/cores" defaultCoreName="collection1" host="127.0.0.1" hostPort="${hostPort:8983}"
- hostContext="${hostContext:solr}" zkClientTimeout="30000" numShards="${numShards:3}" shareSchema="${shareSchema:false}"
+ hostContext="${hostContext:solr}" zkClientTimeout="${solr.zkclienttimeout:30000}" numShards="${numShards:3}" shareSchema="${shareSchema:false}"
distribUpdateConnTimeout="${distribUpdateConnTimeout:15000}" distribUpdateSoTimeout="${distribUpdateSoTimeout:30000}">
<core name="collection1" instanceDir="collection1" shard="${shard:}" collection="${collection:collection1}" config="${solrconfig:solrconfig.xml}" schema="${schema:schema.xml}"/>
<shardHandlerFactory name="shardHandlerFactory" class="HttpShardHandlerFactory">
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 c9c4c61eb55..85358d96fc6 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeySafeLeaderTest.java
@@ -20,6 +20,7 @@ package org.apache.solr.cloud;
import java.util.ArrayList;
import java.util.List;
+import org.apache.lucene.util.LuceneTestCase.BadApple;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.core.SolrCore;
@@ -29,12 +30,12 @@ import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.Ignore;
-@Ignore("SOLR-3126")
+@BadApple
public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase {
private static final int BASE_RUN_LENGTH = 120000;
+ private static final int RUN_LENGTH = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.runlength", Integer.toString(BASE_RUN_LENGTH)));
@BeforeClass
public static void beforeSuperClass() {
@@ -66,8 +67,8 @@ public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase {
public ChaosMonkeySafeLeaderTest() {
super();
- sliceCount = 3;//atLeast(2);
- shardCount = 12;//atLeast(sliceCount*2);
+ sliceCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.slicecount", "3"));
+ shardCount = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.shardcount", "12"));
}
@Override
@@ -91,7 +92,7 @@ public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase {
}
chaosMonkey.startTheMonkey(false, 500);
- int runLength = atLeast(BASE_RUN_LENGTH);
+ int runLength = RUN_LENGTH;
Thread.sleep(runLength);
chaosMonkey.stopTheMonkey();
@@ -113,7 +114,7 @@ public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase {
Thread.sleep(2000);
- waitForThingsToLevelOut(Integer.MAX_VALUE); //Math.round((runLength / 1000.0f / 3.0f)));
+ waitForThingsToLevelOut(180000);
checkShardConsistency(true, true);