LUCENE-3313: more nightly tuning

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1148602 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-07-20 02:25:16 +00:00
parent 8091237ed0
commit b0d84d2aad
6 changed files with 15 additions and 15 deletions

View File

@ -770,9 +770,9 @@ public abstract class LuceneTestCase extends Assert {
* is active and {@link #RANDOM_MULTIPLIER}.
*/
public static boolean rarely(Random random) {
int p = TEST_NIGHTLY ? 25 : 5;
int p = TEST_NIGHTLY ? 10 : 5;
p += (p * Math.log(RANDOM_MULTIPLIER));
int min = 100 - Math.min(p, 90); // never more than 90
int min = 100 - Math.min(p, 50); // never more than 50
return random.nextInt(100) >= min;
}

View File

@ -40,7 +40,7 @@ public class TestStressAdvance extends LuceneTestCase {
doc.add(f);
final Field idField = newField("id", "", Field.Store.YES, Field.Index.NOT_ANALYZED_NO_NORMS);
doc.add(idField);
int num = atLeast(5000);
int num = atLeast(4097);
for(int id=0;id<num;id++) {
if (random.nextInt(4) == 3) {
f.setValue("a");

View File

@ -56,7 +56,7 @@ public class TestNumericRangeQuery32 extends LuceneTestCase {
directory = newDirectory();
RandomIndexWriter writer = new RandomIndexWriter(random, directory,
newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random))
.setMaxBufferedDocs(_TestUtil.nextInt(random, 50, 1000))
.setMaxBufferedDocs(_TestUtil.nextInt(random, 100, 1000))
.setMergePolicy(newLogMergePolicy()));
NumericField
@ -337,7 +337,7 @@ public class TestNumericRangeQuery32 extends LuceneTestCase {
private void testRandomTrieAndClassicRangeQuery(int precisionStep) throws Exception {
String field="field"+precisionStep;
int termCountT=0,termCountC=0;
int num = atLeast(10);
int num = _TestUtil.nextInt(random, 10, 20);
for (int i = 0; i < num; i++) {
int lower=(int)(random.nextDouble()*noDocs*distance)+startOffset;
int upper=(int)(random.nextDouble()*noDocs*distance)+startOffset;
@ -415,7 +415,7 @@ public class TestNumericRangeQuery32 extends LuceneTestCase {
private void testRangeSplit(int precisionStep) throws Exception {
String field="ascfield"+precisionStep;
// 10 random tests
int num = atLeast(10);
int num = _TestUtil.nextInt(random, 10, 20);
for (int i =0; i< num; i++) {
int lower=(int)(random.nextDouble()*noDocs - noDocs/2);
int upper=(int)(random.nextDouble()*noDocs - noDocs/2);
@ -491,7 +491,7 @@ public class TestNumericRangeQuery32 extends LuceneTestCase {
String field="field"+precisionStep;
// 10 random tests, the index order is ascending,
// so using a reverse sort field should retun descending documents
int num = atLeast(10);
int num = _TestUtil.nextInt(random, 10, 20);
for (int i = 0; i < num; i++) {
int lower=(int)(random.nextDouble()*noDocs*distance)+startOffset;
int upper=(int)(random.nextDouble()*noDocs*distance)+startOffset;

View File

@ -53,7 +53,7 @@ public class TestNumericRangeQuery64 extends LuceneTestCase {
directory = newDirectory();
RandomIndexWriter writer = new RandomIndexWriter(random, directory,
newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random))
.setMaxBufferedDocs(_TestUtil.nextInt(random, 50, 1000))
.setMaxBufferedDocs(_TestUtil.nextInt(random, 100, 1000))
.setMergePolicy(newLogMergePolicy()));
NumericField
@ -354,7 +354,7 @@ public class TestNumericRangeQuery64 extends LuceneTestCase {
private void testRandomTrieAndClassicRangeQuery(int precisionStep) throws Exception {
String field="field"+precisionStep;
int termCountT=0,termCountC=0;
int num = atLeast(10);
int num = _TestUtil.nextInt(random, 10, 20);
for (int i = 0; i < num; i++) {
long lower=(long)(random.nextDouble()*noDocs*distance)+startOffset;
long upper=(long)(random.nextDouble()*noDocs*distance)+startOffset;
@ -437,7 +437,7 @@ public class TestNumericRangeQuery64 extends LuceneTestCase {
private void testRangeSplit(int precisionStep) throws Exception {
String field="ascfield"+precisionStep;
// 10 random tests
int num = atLeast(10);
int num = _TestUtil.nextInt(random, 10, 20);
for (int i = 0; i < num; i++) {
long lower=(long)(random.nextDouble()*noDocs - noDocs/2);
long upper=(long)(random.nextDouble()*noDocs - noDocs/2);
@ -523,7 +523,7 @@ public class TestNumericRangeQuery64 extends LuceneTestCase {
String field="field"+precisionStep;
// 10 random tests, the index order is ascending,
// so using a reverse sort field should retun descending documents
int num = atLeast(10);
int num = _TestUtil.nextInt(random, 10, 20);
for (int i = 0; i < num; i++) {
long lower=(long)(random.nextDouble()*noDocs*distance)+startOffset;
long upper=(long)(random.nextDouble()*noDocs*distance)+startOffset;

View File

@ -59,7 +59,7 @@ public class TestPrefixRandom extends LuceneTestCase {
// we generate aweful prefixes: good for testing.
// but for preflex codec, the test can be very slow, so use less iterations.
final String codec = CodecProvider.getDefault().getFieldCodec("field");
int num = codec.equals("PreFlex") ? 200 * RANDOM_MULTIPLIER : atLeast(2000);
int num = codec.equals("PreFlex") ? 200 * RANDOM_MULTIPLIER : atLeast(1000);
for (int i = 0; i < num; i++) {
field.setValue(_TestUtil.randomUnicodeString(random, 10));
writer.addDocument(doc);
@ -114,7 +114,7 @@ public class TestPrefixRandom extends LuceneTestCase {
/** test a bunch of random prefixes */
public void testPrefixes() throws Exception {
int num = atLeast(1000);
int num = atLeast(100);
for (int i = 0; i < num; i++)
assertSame(_TestUtil.randomUnicodeString(random, 5));
}

View File

@ -980,7 +980,7 @@ public class TestFSTs extends LuceneTestCase {
@Nightly
public void testBigSet() throws IOException {
testRandomWords(_TestUtil.nextInt(random, 50000, 60000), atLeast(1));
testRandomWords(_TestUtil.nextInt(random, 50000, 60000), 1);
}
private static String inputToString(int inputMode, IntsRef term) {
@ -1007,7 +1007,7 @@ public class TestFSTs extends LuceneTestCase {
final int RUN_TIME_MSEC = atLeast(500);
final IndexWriterConfig conf = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMaxBufferedDocs(-1).setRAMBufferSizeMB(64);
final File tempDir = _TestUtil.getTempDir("fstlines");
final MockDirectoryWrapper dir = new MockDirectoryWrapper(random, FSDirectory.open(tempDir));
final MockDirectoryWrapper dir = newFSDirectory(tempDir);
final IndexWriter writer = new IndexWriter(dir, conf);
writer.setInfoStream(VERBOSE ? System.out : null);
final long stopTime = System.currentTimeMillis() + RUN_TIME_MSEC;