From a3d1252e7d975471ac75c921a158ac3ceb875381 Mon Sep 17 00:00:00 2001 From: Mark Robert Miller Date: Wed, 26 Dec 2012 04:39:12 +0000 Subject: [PATCH] tests: parameterize git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1425815 13f79535-47bb-0310-9956-ffa450edef68 --- solr/core/src/test-files/solr/solr.xml | 2 +- .../solr/cloud/ChaosMonkeySafeLeaderTest.java | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) 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 --> 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);