Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

tone down more overkill tests

Robert Muircef380630b34
diff --git a/lucene/core/src/test/org/apache/lucene/analysis/TestLookaheadTokenFilter.java b/lucene/core/src/test/org/apache/lucene/analysis/TestLookaheadTokenFilter.java
index 7508bf9f38b..50539e55513 100644
--- a/lucene/core/src/test/org/apache/lucene/analysis/TestLookaheadTokenFilter.java
+++ b/lucene/core/src/test/org/apache/lucene/analysis/TestLookaheadTokenFilter.java
@@ -32,8 +32,9 @@ public class TestLookaheadTokenFilter extends BaseTokenStreamTestCase {
TokenStream output = new MockRandomLookaheadTokenFilter(random, tokenizer);
return new TokenStreamComponents(tokenizer, output);
}
- };
- checkRandomData(random(), a, 200*RANDOM_MULTIPLIER, 8192);
+ };
+ int maxLength = TEST_NIGHTLY ? 8192 : 1024;
+ checkRandomData(random(), a, 50*RANDOM_MULTIPLIER, maxLength);
}
private static class NeverPeeksLookaheadTokenFilter extends LookaheadTokenFilter<LookaheadTokenFilter.Position> {
@@ -60,8 +61,9 @@ public class TestLookaheadTokenFilter extends BaseTokenStreamTestCase {
TokenStream output = new NeverPeeksLookaheadTokenFilter(tokenizer);
return new TokenStreamComponents(tokenizer, output);
}
- };
- checkRandomData(random(), a, 200*RANDOM_MULTIPLIER, 8192);
+ };
+ int maxLength = TEST_NIGHTLY ? 8192 : 1024;
+ checkRandomData(random(), a, 50*RANDOM_MULTIPLIER, maxLength);
}
public void testMissedFirstToken() throws Exception {
diff --git a/lucene/core/src/test/org/apache/lucene/util/fst/TestBytesStore.java b/lucene/core/src/test/org/apache/lucene/util/fst/TestBytesStore.java
index 390bef8b46f..f5db2b610fc 100644
--- a/lucene/core/src/test/org/apache/lucene/util/fst/TestBytesStore.java
+++ b/lucene/core/src/test/org/apache/lucene/util/fst/TestBytesStore.java
@@ -31,8 +31,9 @@ public class TestBytesStore extends LuceneTestCase {
public void testRandom() throws Exception {
final int iters = atLeast(10);
+ final int maxBytes = TEST_NIGHTLY ? 200000 : 20000;
for(int iter=0;iter<iters;iter++) {
- final int numBytes = TestUtil.nextInt(random(), 1, 200000);
+ final int numBytes = TestUtil.nextInt(random(), 1, maxBytes);
final byte[] expected = new byte[numBytes];
final int blockBits = TestUtil.nextInt(random(), 8, 15);
final BytesStore bytes = new BytesStore(blockBits);
diff --git a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
index 779d97fad7e..9eea2dc5ff3 100644
--- a/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
+++ b/lucene/core/src/test/org/apache/lucene/util/packed/TestDirectPacked.java
@@ -85,7 +85,8 @@ public class TestDirectPacked extends LuceneTestCase {
private void doTestBpv(Directory directory, int bpv) throws Exception {
MyRandom random = new MyRandom(random().nextLong());
- for (int i = 0; i < 100; i++) {
+ int numIters = TEST_NIGHTLY ? 100 : 10;
+ for (int i = 0; i < numIters; i++) {
long original[] = randomLongs(random, bpv);
int bitsRequired = bpv == 64 ? 64 : DirectWriter.bitsRequired(1L<<(bpv-1));
String name = "bpv" + bpv + "_" + i;