You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2014/11/27 01:45:32 UTC
svn commit: r1641972 - in
/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene:
index/BaseIndexFileFormatTestCase.java store/MockDirectoryWrapper.java
util/LuceneTestCase.java util/ThrottledIndexOutput.java
Author: rmuir
Date: Thu Nov 27 00:45:32 2014
New Revision: 1641972
URL: http://svn.apache.org/r1641972
Log:
more test speedups
Modified:
lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java?rev=1641972&r1=1641971&r2=1641972&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java Thu Nov 27 00:45:32 2014
@@ -211,6 +211,7 @@ abstract class BaseIndexFileFormatTestCa
}
/** Test the accuracy of the ramBytesUsed estimations. */
+ @Slow
public void testRamBytesUsed() throws IOException {
if (Codec.getDefault() instanceof RandomCodec) {
// this test relies on the fact that two segments will be written with
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java?rev=1641972&r1=1641971&r2=1641972&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java Thu Nov 27 00:45:32 2014
@@ -127,7 +127,7 @@ public class MockDirectoryWrapper extend
// not be reproducible from the original seed
this.randomState = new Random(random.nextInt());
this.throttledOutput = new ThrottledIndexOutput(ThrottledIndexOutput
- .mBitsToBytes(40 + randomState.nextInt(10)), 5 + randomState.nextInt(5), null);
+ .mBitsToBytes(40 + randomState.nextInt(10)), 1 + randomState.nextInt(5), null);
init();
}
@@ -180,7 +180,7 @@ public class MockDirectoryWrapper extend
public static enum Throttling {
/** always emulate a slow hard disk. could be very slow! */
ALWAYS,
- /** sometimes (2% of the time) emulate a slow hard disk. */
+ /** sometimes (0.5% of the time) emulate a slow hard disk. */
SOMETIMES,
/** never throttle output */
NEVER
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java?rev=1641972&r1=1641971&r2=1641972&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java Thu Nov 27 00:45:32 2014
@@ -1315,7 +1315,7 @@ public abstract class LuceneTestCase ext
}
if (rarely(random) && !bare) {
- final double maxMBPerSec = 10 + 5*(random.nextDouble()-0.5);
+ final double maxMBPerSec = TestUtil.nextInt(random, 20, 40);
if (LuceneTestCase.VERBOSE) {
System.out.println("LuceneTestCase: will rate limit output IndexOutput to " + maxMBPerSec + " MB/sec");
}
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java?rev=1641972&r1=1641971&r2=1641972&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java Thu Nov 27 00:45:32 2014
@@ -53,7 +53,7 @@ public class ThrottledIndexOutput extend
}
public static final int mBitsToBytes(int mbits) {
- return mbits * 125000;
+ return mbits * 125000000;
}
public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis,