You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by si...@apache.org on 2011/06/28 16:23:53 UTC
svn commit: r1140635 -
/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java
Author: simonw
Date: Tue Jun 28 14:23:53 2011
New Revision: 1140635
URL: http://svn.apache.org/viewvc?rev=1140635&view=rev
Log:
speed up testcase if TESTS_NIGHTLY=false
Modified:
lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java
Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java?rev=1140635&r1=1140634&r2=1140635&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java Tue Jun 28 14:23:53 2011
@@ -50,16 +50,15 @@ public class TestFlushByRamOrCountsPolic
public void testFlushByRam() throws CorruptIndexException,
LockObtainFailedException, IOException, InterruptedException {
- int[] numThreads = new int[] { 2 + atLeast(1), 1 };
- for (int i = 0; i < numThreads.length; i++) {
- final double ramBuffer = (TEST_NIGHTLY ? 1 : 10) + atLeast(2) + random.nextDouble();
- runFlushByRam(numThreads[i], ramBuffer
- , false);
- }
- for (int i = 0; i < numThreads.length; i++) {
- // with a 256 mb ram buffer we should never stall
- runFlushByRam(numThreads[i], 256.d, true);
- }
+ final double ramBuffer = (TEST_NIGHTLY ? 1 : 10) + atLeast(2)
+ + random.nextDouble();
+ runFlushByRam(1 + random.nextInt(TEST_NIGHTLY ? 5 : 1), ramBuffer, false);
+ }
+
+ public void testFlushByRamLargeBuffer() throws CorruptIndexException,
+ LockObtainFailedException, IOException, InterruptedException {
+ // with a 256 mb ram buffer we should never stall
+ runFlushByRam(1 + random.nextInt(TEST_NIGHTLY ? 5 : 1), 256.d, true);
}
protected void runFlushByRam(int numThreads, double maxRamMB,