Index: common-build.xml
===================================================================
--- common-build.xml (revision 941975)
+++ common-build.xml (working copy)
@@ -55,6 +55,7 @@
+
@@ -439,6 +440,7 @@
+
Index: src/test/org/apache/lucene/analysis/TestCharArrayMap.java
===================================================================
--- src/test/org/apache/lucene/analysis/TestCharArrayMap.java (revision 941975)
+++ src/test/org/apache/lucene/analysis/TestCharArrayMap.java (working copy)
@@ -19,6 +19,7 @@
import java.util.*;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
public class TestCharArrayMap extends LuceneTestCase {
Random r = newRandom();
@@ -55,7 +56,7 @@
}
public void testCharArrayMap() {
- for (int i=0; i<5; i++) { // pump this up for more random testing
+ for (int i=0; i<5*_TestUtil.getRandomMultiplier(); i++) { // pump this up for more random testing
doRandom(1000,false);
doRandom(1000,true);
}
Index: src/test/org/apache/lucene/analysis/TestCharTokenizers.java
===================================================================
--- src/test/org/apache/lucene/analysis/TestCharTokenizers.java (revision 941975)
+++ src/test/org/apache/lucene/analysis/TestCharTokenizers.java (working copy)
@@ -23,6 +23,7 @@
import java.util.Random;
import org.apache.lucene.util.Version;
+import org.apache.lucene.util._TestUtil;
/**
* Testcase for {@link CharTokenizer} subclasses
@@ -38,7 +39,7 @@
Random newRandom = newRandom();
// create random input
int num = 1024 + newRandom.nextInt(1024);
- for (int i = 1; i < num; i++) {
+ for (int i = 1; i < num*_TestUtil.getRandomMultiplier(); i++) {
builder.append("\ud801\udc1cabc");
if((i % 10) == 0)
builder.append(" ");
Index: src/test/org/apache/lucene/store/TestWindowsMMap.java
===================================================================
--- src/test/org/apache/lucene/store/TestWindowsMMap.java (revision 941975)
+++ src/test/org/apache/lucene/store/TestWindowsMMap.java (working copy)
@@ -22,6 +22,7 @@
import java.io.File;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
@@ -83,7 +84,7 @@
writer.commit();
IndexSearcher searcher = new IndexSearcher(dir, true);
- for(int dx = 0; dx < 1000; dx ++) {
+ for(int dx = 0; dx < 1000*_TestUtil.getRandomMultiplier(); dx ++) {
String f = randomField();
Document doc = new Document();
doc.add(new Field("data", f, Field.Store.YES, Field.Index.ANALYZED));
Index: src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java
===================================================================
--- src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestBooleanMinShouldMatch.java (working copy)
@@ -19,6 +19,7 @@
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
import org.apache.lucene.analysis.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
@@ -315,7 +316,7 @@
// increase number of iterations for more complete testing
- for (int i=0; i<50; i++) {
+ for (int i=0; i<50*_TestUtil.getRandomMultiplier(); i++) {
int lev = rnd.nextInt(maxLev);
final long seed = rnd.nextLong();
BooleanQuery q1 = TestBoolean2.randBoolQuery(new Random(seed), true, lev, field, vals, null);
Index: src/test/org/apache/lucene/search/TestSort.java
===================================================================
--- src/test/org/apache/lucene/search/TestSort.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestSort.java (working copy)
@@ -45,6 +45,7 @@
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.DocIdBitSet;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
/**
* Unit tests for sorting code.
@@ -56,7 +57,7 @@
public class TestSort extends LuceneTestCase implements Serializable {
- private static final int NUM_STRINGS = 6000;
+ private static final int NUM_STRINGS = 6000*_TestUtil.getRandomMultiplier();
private Searcher full;
private Searcher searchX;
private Searcher searchY;
Index: src/test/org/apache/lucene/search/TestWildcardRandom.java
===================================================================
--- src/test/org/apache/lucene/search/TestWildcardRandom.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestWildcardRandom.java (working copy)
@@ -28,6 +28,7 @@
import org.apache.lucene.index.Term;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
/**
* Create an index with terms from 0000-9999.
@@ -92,7 +93,7 @@
public void testWildcards() throws Exception {
random = newRandom(System.nanoTime());
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100*_TestUtil.getRandomMultiplier(); i++) {
assertPatternHits("NNNN", 1);
assertPatternHits("?NNN", 10);
assertPatternHits("N?NN", 10);
@@ -100,7 +101,7 @@
assertPatternHits("NNN?", 10);
}
- for (int i = 0; i < 10; i++) {
+ for (int i = 0; i < 10*_TestUtil.getRandomMultiplier(); i++) {
assertPatternHits("??NN", 100);
assertPatternHits("N??N", 100);
assertPatternHits("NN??", 100);
Index: src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java
===================================================================
--- src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestMultiValuedNumericRangeQuery.java (working copy)
@@ -30,6 +30,7 @@
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
public class TestMultiValuedNumericRangeQuery extends LuceneTestCase {
@@ -47,7 +48,7 @@
DecimalFormat format = new DecimalFormat("00000000000", new DecimalFormatSymbols(Locale.US));
- for (int l=0; l<5000; l++) {
+ for (int l=0; l<5000*_TestUtil.getRandomMultiplier(); l++) {
Document doc = new Document();
for (int m=0, c=rnd.nextInt(10); m<=c; m++) {
int value = rnd.nextInt(Integer.MAX_VALUE);
@@ -59,7 +60,7 @@
writer.close();
Searcher searcher=new IndexSearcher(directory, true);
- for (int i=0; i<50; i++) {
+ for (int i=0; i<50*_TestUtil.getRandomMultiplier(); i++) {
int lower=rnd.nextInt(Integer.MAX_VALUE);
int upper=rnd.nextInt(Integer.MAX_VALUE);
if (lower>upper) {
Index: src/test/org/apache/lucene/search/TestBoolean2.java
===================================================================
--- src/test/org/apache/lucene/search/TestBoolean2.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestBoolean2.java (working copy)
@@ -33,6 +33,7 @@
import org.apache.lucene.store.MockRAMDirectory;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
/** Test BooleanQuery2 against BooleanQuery by overriding the standard query parser.
* This also tests the scoring order of BooleanQuery.
@@ -209,7 +210,7 @@
try {
// increase number of iterations for more complete testing
- for (int i=0; i<50; i++) {
+ for (int i=0; i<50*_TestUtil.getRandomMultiplier(); i++) {
int level = rnd.nextInt(3);
q1 = randBoolQuery(new Random(rnd.nextLong()), rnd.nextBoolean(), level, field, vals, null);
Index: src/test/org/apache/lucene/search/TestThreadSafe.java
===================================================================
--- src/test/org/apache/lucene/search/TestThreadSafe.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestThreadSafe.java (working copy)
@@ -17,6 +17,7 @@
*/
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.index.IndexReader;
@@ -147,7 +148,7 @@
buildDir(dir1, 15, 5, 2000);
// do many small tests so the thread locals go away inbetween
- for (int i=0; i<100; i++) {
+ for (int i=0; i<100*_TestUtil.getRandomMultiplier(); i++) {
ir1 = IndexReader.open(dir1, false);
doTest(10,100);
}
Index: src/test/org/apache/lucene/search/TestScorerPerf.java
===================================================================
--- src/test/org/apache/lucene/search/TestScorerPerf.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestScorerPerf.java (working copy)
@@ -2,6 +2,8 @@
import org.apache.lucene.util.DocIdBitSet;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
+
import java.util.Random;
import java.util.BitSet;
import java.io.IOException;
@@ -317,9 +319,9 @@
r = newRandom();
createDummySearcher();
validate=true;
- sets=randBitSets(1000,10);
- doConjunctions(10000,5);
- doNestedConjunctions(10000,3,3);
+ sets=randBitSets(1000*_TestUtil.getRandomMultiplier(),10*_TestUtil.getRandomMultiplier());
+ doConjunctions(10000*_TestUtil.getRandomMultiplier(),5*_TestUtil.getRandomMultiplier());
+ doNestedConjunctions(10000*_TestUtil.getRandomMultiplier(),3*_TestUtil.getRandomMultiplier(),3*_TestUtil.getRandomMultiplier());
s.close();
}
Index: src/test/org/apache/lucene/search/TestRegexpRandom2.java
===================================================================
--- src/test/org/apache/lucene/search/TestRegexpRandom2.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestRegexpRandom2.java (working copy)
@@ -57,7 +57,7 @@
Field field = new Field("field", "", Field.Store.NO, Field.Index.ANALYZED);
doc.add(field);
- for (int i = 0; i < 2000; i++) {
+ for (int i = 0; i < 2000*_TestUtil.getRandomMultiplier(); i++) {
field.setValue(_TestUtil.randomUnicodeString(random));
writer.addDocument(doc);
}
@@ -113,7 +113,7 @@
/** test a bunch of random regular expressions */
public void testRegexps() throws Exception {
- for (int i = 0; i < 1000; i++)
+ for (int i = 0; i < 1000*_TestUtil.getRandomMultiplier(); i++)
assertSame(AutomatonTestUtil.randomRegexp(random).toString());
}
Index: src/test/org/apache/lucene/search/TestRegexpRandom.java
===================================================================
--- src/test/org/apache/lucene/search/TestRegexpRandom.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestRegexpRandom.java (working copy)
@@ -28,6 +28,7 @@
import org.apache.lucene.index.Term;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
/**
* Create an index with terms from 0000-9999.
@@ -91,7 +92,7 @@
public void testRegexps() throws Exception {
random = newRandom(System.nanoTime());
- for (int i = 0; i < 100; i++) {
+ for (int i = 0; i < 100*_TestUtil.getRandomMultiplier(); i++) {
assertPatternHits("NNNN", 1);
assertPatternHits(".NNN", 10);
assertPatternHits("N.NN", 10);
@@ -99,7 +100,7 @@
assertPatternHits("NNN.", 10);
}
- for (int i = 0; i < 10; i++) {
+ for (int i = 0; i < 10*_TestUtil.getRandomMultiplier(); i++) {
assertPatternHits(".{1,2}NN", 100);
assertPatternHits("N.{1,2}N", 100);
assertPatternHits("NN.{1,2}", 100);
Index: src/test/org/apache/lucene/search/TestCustomSearcherSort.java
===================================================================
--- src/test/org/apache/lucene/search/TestCustomSearcherSort.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestCustomSearcherSort.java (working copy)
@@ -39,6 +39,7 @@
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
/**
* Unit test for sorting code.
@@ -52,7 +53,7 @@
private Directory index = null;
private Query query = null;
// reduced from 20000 to 2000 to speed up test...
- private final static int INDEX_SIZE = 2000;
+ private final static int INDEX_SIZE = 2000*_TestUtil.getRandomMultiplier();
public TestCustomSearcherSort (String name) {
super (name);
@@ -152,7 +153,7 @@
private void matchHits (Searcher searcher, Sort sort)
throws IOException {
// make a query without sorting first
- ScoreDoc[] hitsByRank = searcher.search(query, null, 1000).scoreDocs;
+ ScoreDoc[] hitsByRank = searcher.search(query, null, Integer.MAX_VALUE).scoreDocs;
checkHits(hitsByRank, "Sort by rank: "); // check for duplicates
Map resultMap = new TreeMap();
// store hits in TreeMap - TreeMap does not allow duplicates; existing entries are silently overwritten
@@ -163,7 +164,7 @@
}
// now make a query using the sort criteria
- ScoreDoc[] resultSort = searcher.search (query, null, 1000, sort).scoreDocs;
+ ScoreDoc[] resultSort = searcher.search (query, null, Integer.MAX_VALUE, sort).scoreDocs;
checkHits(resultSort, "Sort by custom criteria: "); // check for duplicates
// besides the sorting both sets of hits must be identical
Index: src/test/org/apache/lucene/search/TestNumericRangeQuery32.java
===================================================================
--- src/test/org/apache/lucene/search/TestNumericRangeQuery32.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestNumericRangeQuery32.java (working copy)
@@ -31,6 +31,7 @@
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCaseJ4;
import org.apache.lucene.util.NumericUtils;
+import org.apache.lucene.util._TestUtil;
import org.junit.Test;
import org.junit.AfterClass;
@@ -43,7 +44,7 @@
// shift the starting of the values to the left, to also have negative values:
private static final int startOffset = - 1 << 15;
// number of docs to generate for testing
- private static final int noDocs = 10000;
+ private static final int noDocs = 10000*_TestUtil.getRandomMultiplier();
private static RAMDirectory directory = null;
private static IndexSearcher searcher = null;
@@ -327,7 +328,7 @@
final Random rnd=newRandom();
String field="field"+precisionStep;
int termCountT=0,termCountC=0;
- for (int i=0; i<10; i++) {
+ for (int i=0; i<10*_TestUtil.getRandomMultiplier(); i++) {
int lower=(int)(rnd.nextDouble()*noDocs*distance)+startOffset;
int upper=(int)(rnd.nextDouble()*noDocs*distance)+startOffset;
if (lower>upper) {
@@ -405,7 +406,7 @@
final Random rnd=newRandom();
String field="ascfield"+precisionStep;
// 10 random tests
- for (int i=0; i<10; i++) {
+ for (int i=0; i<10*_TestUtil.getRandomMultiplier(); i++) {
int lower=(int)(rnd.nextDouble()*noDocs - noDocs/2);
int upper=(int)(rnd.nextDouble()*noDocs - noDocs/2);
if (lower>upper) {
@@ -481,7 +482,7 @@
String field="field"+precisionStep;
// 10 random tests, the index order is ascending,
// so using a reverse sort field should retun descending documents
- for (int i=0; i<10; i++) {
+ for (int i=0; i<10*_TestUtil.getRandomMultiplier(); i++) {
int lower=(int)(rnd.nextDouble()*noDocs*distance)+startOffset;
int upper=(int)(rnd.nextDouble()*noDocs*distance)+startOffset;
if (lower>upper) {
Index: src/test/org/apache/lucene/search/TestNumericRangeQuery64.java
===================================================================
--- src/test/org/apache/lucene/search/TestNumericRangeQuery64.java (revision 941975)
+++ src/test/org/apache/lucene/search/TestNumericRangeQuery64.java (working copy)
@@ -29,6 +29,7 @@
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCaseJ4;
import org.apache.lucene.util.NumericUtils;
+import org.apache.lucene.util._TestUtil;
import org.junit.Test;
import org.junit.AfterClass;
@@ -41,7 +42,7 @@
// shift the starting of the values to the left, to also have negative values:
private static final long startOffset = - 1L << 31;
// number of docs to generate for testing
- private static final int noDocs = 10000;
+ private static final int noDocs = 10000*_TestUtil.getRandomMultiplier();
private static RAMDirectory directory = null;
private static IndexSearcher searcher = null;
@@ -345,7 +346,7 @@
final Random rnd=newRandom();
String field="field"+precisionStep;
int termCountT=0,termCountC=0;
- for (int i=0; i<10; i++) {
+ for (int i=0; i<10*_TestUtil.getRandomMultiplier(); i++) {
long lower=(long)(rnd.nextDouble()*noDocs*distance)+startOffset;
long upper=(long)(rnd.nextDouble()*noDocs*distance)+startOffset;
if (lower>upper) {
@@ -428,7 +429,7 @@
final Random rnd=newRandom();
String field="ascfield"+precisionStep;
// 10 random tests
- for (int i=0; i<10; i++) {
+ for (int i=0; i<10*_TestUtil.getRandomMultiplier(); i++) {
long lower=(long)(rnd.nextDouble()*noDocs - noDocs/2);
long upper=(long)(rnd.nextDouble()*noDocs - noDocs/2);
if (lower>upper) {
@@ -514,7 +515,7 @@
String field="field"+precisionStep;
// 10 random tests, the index order is ascending,
// so using a reverse sort field should retun descending documents
- for (int i=0; i<10; i++) {
+ for (int i=0; i<10*_TestUtil.getRandomMultiplier(); i++) {
long lower=(long)(rnd.nextDouble()*noDocs*distance)+startOffset;
long upper=(long)(rnd.nextDouble()*noDocs*distance)+startOffset;
if (lower>upper) {
Index: src/test/org/apache/lucene/index/TestStressIndexing2.java
===================================================================
--- src/test/org/apache/lucene/index/TestStressIndexing2.java (revision 941975)
+++ src/test/org/apache/lucene/index/TestStressIndexing2.java (working copy)
@@ -103,7 +103,7 @@
r = newRandom();
- for (int i=0; i<3; i++) { // increase iterations for better testing
+ for (int i=0; i<3*_TestUtil.getRandomMultiplier(); i++) { // increase iterations for better testing
sameFieldOrder=r.nextBoolean();
mergeFactor=r.nextInt(3)+2;
maxBufferedDocs=r.nextInt(3)+2;
Index: src/test/org/apache/lucene/index/TestIndexWriter.java
===================================================================
--- src/test/org/apache/lucene/index/TestIndexWriter.java (revision 941975)
+++ src/test/org/apache/lucene/index/TestIndexWriter.java (working copy)
@@ -3407,7 +3407,7 @@
BytesRef utf8 = new BytesRef(20);
UnicodeUtil.UTF16Result utf16 = new UnicodeUtil.UTF16Result();
- for(int iter=0;iter<100000;iter++) {
+ for(int iter=0;iter<100000*_TestUtil.getRandomMultiplier();iter++) {
boolean hasIllegal = fillUnicode(buffer, expected, 0, 20);
UnicodeUtil.UTF16toUTF8(buffer, 0, 20, utf8);
@@ -3438,7 +3438,7 @@
boolean hasIllegal = false;
byte[] last = new byte[60];
- for(int iter=0;iter<100000;iter++) {
+ for(int iter=0;iter<100000*_TestUtil.getRandomMultiplier();iter++) {
final int prefix;
@@ -4748,7 +4748,7 @@
Random rnd = newRandom();
final Set allTerms = new HashSet();
- for(int i=0;i<200;i++) {
+ for(int i=0;i<200*_TestUtil.getRandomMultiplier();i++) {
final String s;
if (rnd.nextBoolean()) {
@@ -4783,7 +4783,6 @@
// Test each sub-segment
final IndexReader[] subs = r.getSequentialSubReaders();
- assertEquals(5, subs.length);
for(int i=0;i 16 to test skipping
Index: src/test/org/apache/lucene/index/TestByteSlices.java
===================================================================
--- src/test/org/apache/lucene/index/TestByteSlices.java (revision 941975)
+++ src/test/org/apache/lucene/index/TestByteSlices.java (working copy)
@@ -18,6 +18,7 @@
import java.util.ArrayList;
import java.util.List;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
public class TestByteSlices extends LuceneTestCase {
@@ -73,7 +74,7 @@
counters[stream] = 0;
}
- for(int iter=0;iter<10000;iter++) {
+ for(int iter=0;iter<10000*_TestUtil.getRandomMultiplier();iter++) {
int stream = r.nextInt(NUM_STREAM);
if (VERBOSE)
System.out.println("write stream=" + stream);
Index: src/test/org/apache/lucene/index/TestAtomicUpdate.java
===================================================================
--- src/test/org/apache/lucene/index/TestAtomicUpdate.java (revision 941975)
+++ src/test/org/apache/lucene/index/TestAtomicUpdate.java (working copy)
@@ -47,7 +47,7 @@
private static abstract class TimedThread extends Thread {
volatile boolean failed;
int count;
- private static float RUN_TIME_SEC = 0.5f;
+ private static float RUN_TIME_SEC = 0.5f * (float)_TestUtil.getRandomMultiplier();
private TimedThread[] allThreads;
abstract public void doWork() throws Throwable;
Index: src/test/org/apache/lucene/index/TestIndexReaderReopen.java
===================================================================
--- src/test/org/apache/lucene/index/TestIndexReaderReopen.java (revision 941975)
+++ src/test/org/apache/lucene/index/TestIndexReaderReopen.java (working copy)
@@ -47,6 +47,7 @@
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.BitVector;
+import org.apache.lucene.util._TestUtil;
public class TestIndexReaderReopen extends LuceneTestCase {
@@ -702,7 +703,7 @@
public void testThreadSafety() throws Exception {
final Directory dir = new MockRAMDirectory();
- final int n = 30;
+ final int n = 30*_TestUtil.getRandomMultiplier();
IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(
TEST_VERSION_CURRENT, new StandardAnalyzer(TEST_VERSION_CURRENT)));
Index: src/test/org/apache/lucene/index/TestStressIndexing.java
===================================================================
--- src/test/org/apache/lucene/index/TestStressIndexing.java (revision 941975)
+++ src/test/org/apache/lucene/index/TestStressIndexing.java (working copy)
@@ -32,7 +32,7 @@
private static abstract class TimedThread extends Thread {
volatile boolean failed;
int count;
- private static int RUN_TIME_SEC = 1;
+ private static int RUN_TIME_SEC = 1*_TestUtil.getRandomMultiplier();
private TimedThread[] allThreads;
abstract public void doWork() throws Throwable;
Index: src/test/org/apache/lucene/index/TestPayloads.java
===================================================================
--- src/test/org/apache/lucene/index/TestPayloads.java (revision 941975)
+++ src/test/org/apache/lucene/index/TestPayloads.java (working copy)
@@ -481,7 +481,7 @@
public void testThreadSafety() throws Exception {
rnd = newRandom();
final int numThreads = 5;
- final int numDocs = 50;
+ final int numDocs = 50* _TestUtil.getRandomMultiplier();
final ByteArrayPool pool = new ByteArrayPool(numThreads, 5);
Directory dir = new MockRAMDirectory();
Index: src/test/org/apache/lucene/index/FlexTestUtil.java
===================================================================
--- src/test/org/apache/lucene/index/FlexTestUtil.java (revision 941975)
+++ src/test/org/apache/lucene/index/FlexTestUtil.java (working copy)
@@ -428,7 +428,7 @@
}
private static void testRandomSeeks(Random rand, IndexReader r) throws Exception {
- final int ITER = 100;
+ final int ITER = 100 * _TestUtil.getRandomMultiplier();
List allFields = new ArrayList();
Fields fields = MultiFields.getFields(r);
if (fields == null) {
Index: src/test/org/apache/lucene/util/packed/TestPackedInts.java
===================================================================
--- src/test/org/apache/lucene/util/packed/TestPackedInts.java (revision 941975)
+++ src/test/org/apache/lucene/util/packed/TestPackedInts.java (working copy)
@@ -19,6 +19,7 @@
import org.apache.lucene.store.*;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
import java.util.ArrayList;
import java.util.List;
@@ -51,7 +52,7 @@
public void testPackedInts() throws IOException {
rnd = newRandom();
- for(int iter=0;iter<5;iter++) {
+ for(int iter=0;iter<5*_TestUtil.getRandomMultiplier();iter++) {
long ceil = 2;
for(int nbits=1;nbits<63;nbits++) {
final int valueCount = 100+rnd.nextInt(500);
Index: src/test/org/apache/lucene/util/TestIndexableBinaryStringTools.java
===================================================================
--- src/test/org/apache/lucene/util/TestIndexableBinaryStringTools.java (revision 941975)
+++ src/test/org/apache/lucene/util/TestIndexableBinaryStringTools.java (working copy)
@@ -22,8 +22,8 @@
import java.nio.ByteBuffer;
public class TestIndexableBinaryStringTools extends LuceneTestCase {
- private static final int NUM_RANDOM_TESTS = 2000;
- private static final int MAX_RANDOM_BINARY_LENGTH = 300;
+ private static final int NUM_RANDOM_TESTS = 2000*_TestUtil.getRandomMultiplier();
+ private static final int MAX_RANDOM_BINARY_LENGTH = 300*_TestUtil.getRandomMultiplier();
/** @deprecated remove this test for Lucene 4.0 */
@Deprecated
Index: src/test/org/apache/lucene/util/_TestUtil.java
===================================================================
--- src/test/org/apache/lucene/util/_TestUtil.java (revision 941975)
+++ src/test/org/apache/lucene/util/_TestUtil.java (working copy)
@@ -140,4 +140,10 @@
}
return new String(buffer, 0, end);
}
+
+ /** gets a random multiplier, which you should use when writing
+ * random tests: multiply it by the number of iterations */
+ public static int getRandomMultiplier() {
+ return Integer.parseInt(System.getProperty("random.multiplier", "1"));
+ }
}
Index: src/test/org/apache/lucene/util/TestArrayUtil.java
===================================================================
--- src/test/org/apache/lucene/util/TestArrayUtil.java (revision 941975)
+++ src/test/org/apache/lucene/util/TestArrayUtil.java (working copy)
@@ -49,7 +49,7 @@
public void testInvalidElementSizes() {
final Random r = newRandom();
- for(int iter=0;iter<10000;iter++) {
+ for(int iter=0;iter<10000*_TestUtil.getRandomMultiplier();iter++) {
final int minTargetSize = r.nextInt(Integer.MAX_VALUE);
final int elemSize = r.nextInt(11);
final int v = ArrayUtil.oversize(minTargetSize, elemSize);
Index: src/test/org/apache/lucene/util/TestOpenBitSet.java
===================================================================
--- src/test/org/apache/lucene/util/TestOpenBitSet.java (revision 941975)
+++ src/test/org/apache/lucene/util/TestOpenBitSet.java (working copy)
@@ -175,8 +175,8 @@
// larger testsuite.
public void testSmall() {
rand = newRandom();
- doRandomSets(1200,1000, 1);
- doRandomSets(1200,1000, 2);
+ doRandomSets(1200*_TestUtil.getRandomMultiplier(),1000*_TestUtil.getRandomMultiplier(), 1);
+ doRandomSets(1200*_TestUtil.getRandomMultiplier(),1000*_TestUtil.getRandomMultiplier(), 2);
}
public void testBig() {
Index: src/test/org/apache/lucene/util/cache/TestSimpleLRUCache.java
===================================================================
--- src/test/org/apache/lucene/util/cache/TestSimpleLRUCache.java (revision 941975)
+++ src/test/org/apache/lucene/util/cache/TestSimpleLRUCache.java (working copy)
@@ -22,6 +22,6 @@
public class TestSimpleLRUCache extends BaseTestLRU {
public void testLRUCache() throws Exception {
final int n = 100;
- testCache(new SimpleLRUCache(n), n);
+ testCache(new SimpleLRUCache(n), n);
}
}
Index: src/test/org/apache/lucene/util/cache/TestDoubleBarrelLRUCache.java
===================================================================
--- src/test/org/apache/lucene/util/cache/TestDoubleBarrelLRUCache.java (revision 941975)
+++ src/test/org/apache/lucene/util/cache/TestDoubleBarrelLRUCache.java (working copy)
@@ -21,17 +21,17 @@
public void testLRUCache() throws Exception {
final int n = 100;
- testCache(new DoubleBarrelLRUCache(n), n);
+ testCache(new DoubleBarrelLRUCache(n), n);
}
private class CacheThread extends Thread {
- private final Object[] objs;
- private final Cache