tests: improve cm tests

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1446981 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-02-17 00:22:57 +00:00
parent 2d60ca9bbd
commit 534d8b170e
2 changed files with 16 additions and 8 deletions

View File

@ -46,7 +46,7 @@ import org.slf4j.LoggerFactory;
public class ChaosMonkeyNothingIsSafeTest extends AbstractFullDistribZkTestBase {
public static Logger log = LoggerFactory.getLogger(ChaosMonkeyNothingIsSafeTest.class);
private static final int BASE_RUN_LENGTH = 60000;
private static final Integer RUN_LENGTH = Integer.parseInt(System.getProperty("solr.tests.cloud.cm.runlength", "-1"));
@BeforeClass
public static void beforeSuperClass() {
@ -138,8 +138,15 @@ public class ChaosMonkeyNothingIsSafeTest extends AbstractFullDistribZkTestBase
}
chaosMonkey.startTheMonkey(true, 10000);
//int runLength = atLeast(BASE_RUN_LENGTH);
int runLength = BASE_RUN_LENGTH;
long runLength;
if (RUN_LENGTH != -1) {
runLength = RUN_LENGTH;
} else {
int[] runTimes = new int[] {5000,6000,10000,15000,15000,30000,30000,45000,90000,120000};
runLength = runTimes[random().nextInt(runTimes.length - 1)];
}
try {
Thread.sleep(runLength);
} finally {
@ -172,7 +179,7 @@ public class ChaosMonkeyNothingIsSafeTest extends AbstractFullDistribZkTestBase
// make sure we again have leaders for each shard
for (int j = 1; j < sliceCount; j++) {
zkStateReader.getLeaderRetry(DEFAULT_COLLECTION, "shard" + j, 10000);
zkStateReader.getLeaderRetry(DEFAULT_COLLECTION, "shard" + j, 30000);
}
commit();

View File

@ -109,10 +109,11 @@ public class ChaosMonkeySafeLeaderTest extends AbstractFullDistribZkTestBase {
int[] runTimes = new int[] {5000,6000,10000,15000,15000,30000,30000,45000,90000,120000};
runLength = runTimes[random().nextInt(runTimes.length - 1)];
}
try {
Thread.sleep(runLength);
} finally {
chaosMonkey.stopTheMonkey();
}
for (StopableIndexingThread indexThread : threads) {
indexThread.safeStop();