more test speedups

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1641972 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2014-11-27 00:45:32 +00:00
parent 7d0cd063e3
commit 81a557ab16
4 changed files with 5 additions and 4 deletions

View File

@ -211,6 +211,7 @@ abstract class BaseIndexFileFormatTestCase extends LuceneTestCase {
}
/** 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

View File

@ -127,7 +127,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
// 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 extends BaseDirectoryWrapper {
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

View File

@ -1315,7 +1315,7 @@ public abstract class LuceneTestCase extends Assert {
}
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");
}

View File

@ -53,7 +53,7 @@ public class ThrottledIndexOutput extends IndexOutput {
}
public static final int mBitsToBytes(int mbits) {
return mbits * 125000;
return mbits * 125000000;
}
public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis,