speed up testcase if TESTS_NIGHTLY=false

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1140635 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2011-06-28 14:23:53 +00:00
parent 95028899b6
commit 5937246af2
1 changed files with 9 additions and 10 deletions

View File

@ -50,16 +50,15 @@ public class TestFlushByRamOrCountsPolicy extends LuceneTestCase {
public void testFlushByRam() throws CorruptIndexException, public void testFlushByRam() throws CorruptIndexException,
LockObtainFailedException, IOException, InterruptedException { LockObtainFailedException, IOException, InterruptedException {
int[] numThreads = new int[] { 2 + atLeast(1), 1 }; final double ramBuffer = (TEST_NIGHTLY ? 1 : 10) + atLeast(2)
for (int i = 0; i < numThreads.length; i++) { + random.nextDouble();
final double ramBuffer = (TEST_NIGHTLY ? 1 : 10) + atLeast(2) + random.nextDouble(); runFlushByRam(1 + random.nextInt(TEST_NIGHTLY ? 5 : 1), ramBuffer, false);
runFlushByRam(numThreads[i], ramBuffer }
, false);
} public void testFlushByRamLargeBuffer() throws CorruptIndexException,
for (int i = 0; i < numThreads.length; i++) { LockObtainFailedException, IOException, InterruptedException {
// with a 256 mb ram buffer we should never stall // with a 256 mb ram buffer we should never stall
runFlushByRam(numThreads[i], 256.d, true); runFlushByRam(1 + random.nextInt(TEST_NIGHTLY ? 5 : 1), 256.d, true);
}
} }
protected void runFlushByRam(int numThreads, double maxRamMB, protected void runFlushByRam(int numThreads, double maxRamMB,