Apache Lucene open-source search software
more test speedups
Robert Muir81a557ab16fe
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.javaindex 83209ac4745..05cace127b5 100644--- a/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java+++ b/lucene/test-framework/src/java/org/apache/lucene/index/BaseIndexFileFormatTestCase.java@@ -211,6 +211,7 @@ abstract class BaseIndexFileFormatTestCase extends LuceneTestCase {}/** Test the accuracy of the ramBytesUsed estimations. */+ @Slowpublic void testRamBytesUsed() throws IOException {if (Codec.getDefault() instanceof RandomCodec) {// this test relies on the fact that two segments will be written withdiff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.javaindex bfe9f83f0d1..cea731bb6c7 100644--- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java+++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java@@ -127,7 +127,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {// not be reproducible from the original seedthis.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 */NEVERdiff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.javaindex c794f9e91c3..78b4da71a81 100644--- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java+++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java@@ -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");}diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java b/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.javaindex 1c93bf8ef7e..c7a9cbef883 100644--- a/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java+++ b/lucene/test-framework/src/java/org/apache/lucene/util/ThrottledIndexOutput.java@@ -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,