Apache Solr open-source search software
LUCENE-5606: un-ignore monster tests, instead annotate with a test group so they can be optionally run
Robert Muir3a0686357180
diff --git a/lucene/common-build.xml b/lucene/common-build.xmlindex 2830e300a70..36ce8e9bfdf 100644--- a/lucene/common-build.xml+++ b/lucene/common-build.xml@@ -111,6 +111,7 @@<property name="tests.loggingfile" location="${common.dir}/tools/junit4/logging.properties"/><property name="tests.nightly" value="false" /><property name="tests.weekly" value="false" />+ <property name="tests.monster" value="false" /><property name="tests.slow" value="true" /><property name="tests.cleanthreads.sysprop" value="perMethod"/><property name="tests.asserts.gracious" value="false"/>@@ -819,6 +820,7 @@<attribute name="threadNum" default="1"/><attribute name="tests.nightly" default="${tests.nightly}"/><attribute name="tests.weekly" default="${tests.weekly}"/>+ <attribute name="tests.monster" default="${tests.monster}"/><attribute name="tests.slow" default="${tests.slow}"/><attribute name="tests.multiplier" default="${tests.multiplier}"/>@@ -950,6 +952,8 @@<sysproperty key="tests.nightly" value="@{tests.nightly}"/><!-- set whether or not weekly tests should run --><sysproperty key="tests.weekly" value="@{tests.weekly}"/>+ <!-- set whether or not monster tests should run -->+ <sysproperty key="tests.monster" value="@{tests.monster}"/><!-- set whether or not slow tests should run --><sysproperty key="tests.slow" value="@{tests.slow}"/>diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java b/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.javaindex a9e61ccd2ac..96b6eb3762e 100644--- a/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BBinaryDocValues.java@@ -26,14 +26,15 @@ import org.apache.lucene.store.ByteArrayDataOutput;import org.apache.lucene.store.MockDirectoryWrapper;import org.apache.lucene.util.BytesRef;import org.apache.lucene.util.LuceneTestCase;-import org.apache.lucene.util.TestUtil;+import org.apache.lucene.util.LuceneTestCase.Monster;+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;import org.apache.lucene.util.TimeUnits;-import org.junit.Ignore;import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;+@SuppressCodecs({"SimpleText", "Memory", "Direct"})@TimeoutSuite(millis = 80 * TimeUnits.HOUR)-@Ignore("takes ~ 45 minutes")+@Monster("takes ~ 45 minutes")public class Test2BBinaryDocValues extends LuceneTestCase {// indexes Integer.MAX_VALUE docs with a fixed binary fielddiff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java b/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.javaindex b8a623ff060..01fbdc520f7 100644--- a/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BNumericDocValues.java@@ -23,14 +23,15 @@ import org.apache.lucene.document.NumericDocValuesField;import org.apache.lucene.store.BaseDirectoryWrapper;import org.apache.lucene.store.MockDirectoryWrapper;import org.apache.lucene.util.LuceneTestCase;-import org.apache.lucene.util.TestUtil;import org.apache.lucene.util.TimeUnits;-import org.junit.Ignore;+import org.apache.lucene.util.LuceneTestCase.Monster;+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;+@SuppressCodecs({"SimpleText", "Memory", "Direct"})@TimeoutSuite(millis = 80 * TimeUnits.HOUR)-@Ignore("takes ~ 30 minutes")+@Monster("takes ~ 30 minutes")public class Test2BNumericDocValues extends LuceneTestCase {// indexes Integer.MAX_VALUE docs with an increasing dv fielddiff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BPositions.java b/lucene/core/src/test/org/apache/lucene/index/Test2BPositions.javaindex 496959d7a45..91454853eeb 100644--- a/lucene/core/src/test/org/apache/lucene/index/Test2BPositions.java+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BPositions.java@@ -31,6 +31,7 @@ import org.apache.lucene.util.LuceneTestCase;import org.apache.lucene.util.TestUtil;import org.apache.lucene.util.TimeUnits;import org.apache.lucene.util.TestUtil;+import org.apache.lucene.util.LuceneTestCase.Monster;import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;import org.junit.Ignore;@@ -42,10 +43,9 @@ import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;*/@SuppressCodecs({ "SimpleText", "Memory", "Direct" })@TimeoutSuite(millis = 4 * TimeUnits.HOUR)+@Monster("uses lots of space and takes a few minutes")public class Test2BPositions extends LuceneTestCase {- // uses lots of space and takes a few minutes- @Ignore("Very slow. Enable manually by removing @Ignore.")public void test() throws Exception {BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BPositions"));if (dir instanceof MockDirectoryWrapper) {diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java b/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.javaindex 08dfcfbdde0..06321c18b6a 100644--- a/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BPostingsBytes.java@@ -32,8 +32,8 @@ import org.apache.lucene.store.MockDirectoryWrapper;import org.apache.lucene.util.LuceneTestCase;import org.apache.lucene.util.TestUtil;import org.apache.lucene.util.TimeUnits;+import org.apache.lucene.util.LuceneTestCase.Monster;import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;-import org.junit.Ignore;import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;@@ -44,11 +44,9 @@ import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;*/@SuppressCodecs({ "SimpleText", "Memory", "Direct" })@TimeoutSuite(millis = 4 * TimeUnits.HOUR)+@Monster("takes ~20GB-30GB of space and 10 minutes, and more heap space sometimes")public class Test2BPostingsBytes extends LuceneTestCase {- // @Absurd @Ignore takes ~20GB-30GB of space and 10 minutes.- // with some codecs needs more heap space as well.- @Ignore("Very slow. Enable manually by removing @Ignore.")public void test() throws Exception {BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BPostingsBytes1"));if (dir instanceof MockDirectoryWrapper) {diff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java b/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.javaindex c1b99572e86..37d63ad529a 100644--- a/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BSortedDocValues.java@@ -25,14 +25,16 @@ import org.apache.lucene.document.SortedDocValuesField;import org.apache.lucene.store.BaseDirectoryWrapper;import org.apache.lucene.store.MockDirectoryWrapper;import org.apache.lucene.util.BytesRef;-import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;import org.apache.lucene.util.LuceneTestCase;import org.apache.lucene.util.TimeUnits;-import org.junit.Ignore;+import org.apache.lucene.util.LuceneTestCase.Monster;+import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;+import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;+@SuppressCodecs({"SimpleText", "Memory", "Direct"})@TimeoutSuite(millis = 80 * TimeUnits.HOUR)-@Ignore("very slow")+@Monster("very slow")public class Test2BSortedDocValues extends LuceneTestCase {// indexes Integer.MAX_VALUE docs with a fixed binary fielddiff --git a/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java b/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.javaindex 508cbabbead..6ca07bcf737 100644--- a/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java+++ b/lucene/core/src/test/org/apache/lucene/index/Test2BTerms.java@@ -18,6 +18,7 @@ package org.apache.lucene.index;*/import org.apache.lucene.util.*;+import org.apache.lucene.util.LuceneTestCase.Monster;import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;import org.apache.lucene.store.*;import org.apache.lucene.search.*;@@ -37,11 +38,12 @@ import java.util.Random;// disk (but, should run successfully). Best to run w/// -Dtests.codec=<current codec>, and w/ plenty of RAM, eg://-// ant test -Dtest.slow=true -Dtests.heapsize=8g+// ant test -Dtests.monster=true -Dtests.heapsize=8g//// java -server -Xmx8g -d64 -cp .:lib/junit-4.10.jar:./build/classes/test:./build/classes/test-framework:./build/classes/java -Dlucene.version=4.0-dev -Dtests.directory=MMapDirectory -DtempDir=build -ea org.junit.runner.JUnitCore org.apache.lucene.index.Test2BTerms//@SuppressCodecs({ "SimpleText", "Memory", "Direct" })+@Monster("very slow, use 8g heap")public class Test2BTerms extends LuceneTestCase {private final static int TOKEN_LEN = 5;@@ -145,7 +147,6 @@ public class Test2BTerms extends LuceneTestCase {}}- @Ignore("Very slow. Enable manually by removing @Ignore.")public void test2BTerms() throws IOException {System.out.println("Starting Test2B");diff --git a/lucene/core/src/test/org/apache/lucene/util/Test2BPagedBytes.java b/lucene/core/src/test/org/apache/lucene/util/Test2BPagedBytes.javaindex a7d3f6be0aa..32ddab5d530 100644--- a/lucene/core/src/test/org/apache/lucene/util/Test2BPagedBytes.java+++ b/lucene/core/src/test/org/apache/lucene/util/Test2BPagedBytes.java@@ -24,9 +24,10 @@ import org.apache.lucene.store.IOContext;import org.apache.lucene.store.IndexInput;import org.apache.lucene.store.IndexOutput;import org.apache.lucene.store.MockDirectoryWrapper;+import org.apache.lucene.util.LuceneTestCase.Monster;import org.junit.Ignore;-@Ignore("You must increase heap to > 2 G to run this")+@Monster("You must increase heap to > 2 G to run this")public class Test2BPagedBytes extends LuceneTestCase {public void test() throws Exception {diff --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 4a6df5e222f..79ffca79bef 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@@ -236,6 +236,7 @@ public abstract class LuceneTestCase extends Assert {public static final String SYSPROP_NIGHTLY = "tests.nightly";public static final String SYSPROP_WEEKLY = "tests.weekly";+ public static final String SYSPROP_MONSTER = "tests.monster";public static final String SYSPROP_AWAITSFIX = "tests.awaitsfix";public static final String SYSPROP_SLOW = "tests.slow";public static final String SYSPROP_BADAPPLES = "tests.badapples";@@ -263,6 +264,17 @@ public abstract class LuceneTestCase extends Assert {@Retention(RetentionPolicy.RUNTIME)@TestGroup(enabled = false, sysProperty = SYSPROP_WEEKLY)public @interface Weekly {}++ /**+ * Annotation for monster tests that require special setup (e.g. use tons of disk and RAM)+ */+ @Documented+ @Inherited+ @Retention(RetentionPolicy.RUNTIME)+ @TestGroup(enabled = false, sysProperty = SYSPROP_MONSTER)+ public @interface Monster {+ String value();+ }/*** Annotation for tests which exhibit a known issue and are temporarily disabled.