Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

reduce cost of test if PF is SimpleText

Michael McCandless536a7379c959
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java
index 0faae6172c3..d62e475b34a 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPositions.java
@@ -45,6 +45,12 @@ public class TestBagOfPositions extends LuceneTestCase {
List<String> postingsList = new ArrayList<String>();
int numTerms = atLeast(300);
final int maxTermsPerDoc = _TestUtil.nextInt(random(), 10, 20);
+ boolean isSimpleText = "SimpleText".equals(_TestUtil.getPostingsFormat("field"));
+
+ if (isSimpleText && (TEST_NIGHTLY || RANDOM_MULTIPLIER > 1)) {
+ // Otherwise test can take way too long (> 2 hours)
+ numTerms /= 2;
+ }
if (VERBOSE) {
System.out.println("maxTermsPerDoc=" + maxTermsPerDoc);
System.out.println("numTerms=" + numTerms);
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
index f4e66faea1e..8ba54b635d6 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestBagOfPostings.java
@@ -46,7 +46,7 @@ public class TestBagOfPostings extends LuceneTestCase {
boolean isSimpleText = "SimpleText".equals(_TestUtil.getPostingsFormat("field"));
- if (isSimpleText && TEST_NIGHTLY) {
+ if (isSimpleText && (TEST_NIGHTLY || RANDOM_MULTIPLIER > 1)) {
// Otherwise test can take way too long (> 2 hours)
numTerms /= 2;
}