LUCENE-5606: un-ignore monster tests, instead annotate with a test group so they can be optionally run

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1587769 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2014-04-16 01:32:45 +00:00
parent d393b2916c
commit 3a06863571
9 changed files with 38 additions and 18 deletions

View File

@ -111,6 +111,7 @@
<property name="tests.loggingfile" location="${common.dir}/tools/junit4/logging.properties"/> <property name="tests.loggingfile" location="${common.dir}/tools/junit4/logging.properties"/>
<property name="tests.nightly" value="false" /> <property name="tests.nightly" value="false" />
<property name="tests.weekly" value="false" /> <property name="tests.weekly" value="false" />
<property name="tests.monster" value="false" />
<property name="tests.slow" value="true" /> <property name="tests.slow" value="true" />
<property name="tests.cleanthreads.sysprop" value="perMethod"/> <property name="tests.cleanthreads.sysprop" value="perMethod"/>
<property name="tests.asserts.gracious" value="false"/> <property name="tests.asserts.gracious" value="false"/>
@ -819,6 +820,7 @@
<attribute name="threadNum" default="1"/> <attribute name="threadNum" default="1"/>
<attribute name="tests.nightly" default="${tests.nightly}"/> <attribute name="tests.nightly" default="${tests.nightly}"/>
<attribute name="tests.weekly" default="${tests.weekly}"/> <attribute name="tests.weekly" default="${tests.weekly}"/>
<attribute name="tests.monster" default="${tests.monster}"/>
<attribute name="tests.slow" default="${tests.slow}"/> <attribute name="tests.slow" default="${tests.slow}"/>
<attribute name="tests.multiplier" default="${tests.multiplier}"/> <attribute name="tests.multiplier" default="${tests.multiplier}"/>
@ -950,6 +952,8 @@
<sysproperty key="tests.nightly" value="@{tests.nightly}"/> <sysproperty key="tests.nightly" value="@{tests.nightly}"/>
<!-- set whether or not weekly tests should run --> <!-- set whether or not weekly tests should run -->
<sysproperty key="tests.weekly" value="@{tests.weekly}"/> <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 --> <!-- set whether or not slow tests should run -->
<sysproperty key="tests.slow" value="@{tests.slow}"/> <sysproperty key="tests.slow" value="@{tests.slow}"/>

View File

@ -26,14 +26,15 @@ import org.apache.lucene.store.ByteArrayDataOutput;
import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase; 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.apache.lucene.util.TimeUnits;
import org.junit.Ignore;
import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
@SuppressCodecs({"SimpleText", "Memory", "Direct"})
@TimeoutSuite(millis = 80 * TimeUnits.HOUR) @TimeoutSuite(millis = 80 * TimeUnits.HOUR)
@Ignore("takes ~ 45 minutes") @Monster("takes ~ 45 minutes")
public class Test2BBinaryDocValues extends LuceneTestCase { public class Test2BBinaryDocValues extends LuceneTestCase {
// indexes Integer.MAX_VALUE docs with a fixed binary field // indexes Integer.MAX_VALUE docs with a fixed binary field

View File

@ -23,14 +23,15 @@ import org.apache.lucene.document.NumericDocValuesField;
import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.BaseDirectoryWrapper;
import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.TimeUnits; 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; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
@SuppressCodecs({"SimpleText", "Memory", "Direct"})
@TimeoutSuite(millis = 80 * TimeUnits.HOUR) @TimeoutSuite(millis = 80 * TimeUnits.HOUR)
@Ignore("takes ~ 30 minutes") @Monster("takes ~ 30 minutes")
public class Test2BNumericDocValues extends LuceneTestCase { public class Test2BNumericDocValues extends LuceneTestCase {
// indexes Integer.MAX_VALUE docs with an increasing dv field // indexes Integer.MAX_VALUE docs with an increasing dv field

View File

@ -31,6 +31,7 @@ import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.TimeUnits; import org.apache.lucene.util.TimeUnits;
import org.apache.lucene.util.TestUtil; 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.LuceneTestCase.SuppressCodecs;
import org.junit.Ignore; import org.junit.Ignore;
@ -42,10 +43,9 @@ import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
*/ */
@SuppressCodecs({ "SimpleText", "Memory", "Direct" }) @SuppressCodecs({ "SimpleText", "Memory", "Direct" })
@TimeoutSuite(millis = 4 * TimeUnits.HOUR) @TimeoutSuite(millis = 4 * TimeUnits.HOUR)
@Monster("uses lots of space and takes a few minutes")
public class Test2BPositions extends LuceneTestCase { 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 { public void test() throws Exception {
BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BPositions")); BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BPositions"));
if (dir instanceof MockDirectoryWrapper) { if (dir instanceof MockDirectoryWrapper) {

View File

@ -32,8 +32,8 @@ import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TestUtil; import org.apache.lucene.util.TestUtil;
import org.apache.lucene.util.TimeUnits; import org.apache.lucene.util.TimeUnits;
import org.apache.lucene.util.LuceneTestCase.Monster;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.junit.Ignore;
import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
@ -44,11 +44,9 @@ import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
*/ */
@SuppressCodecs({ "SimpleText", "Memory", "Direct" }) @SuppressCodecs({ "SimpleText", "Memory", "Direct" })
@TimeoutSuite(millis = 4 * TimeUnits.HOUR) @TimeoutSuite(millis = 4 * TimeUnits.HOUR)
@Monster("takes ~20GB-30GB of space and 10 minutes, and more heap space sometimes")
public class Test2BPostingsBytes extends LuceneTestCase { 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 { public void test() throws Exception {
BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BPostingsBytes1")); BaseDirectoryWrapper dir = newFSDirectory(createTempDir("2BPostingsBytes1"));
if (dir instanceof MockDirectoryWrapper) { if (dir instanceof MockDirectoryWrapper) {

View File

@ -25,14 +25,16 @@ import org.apache.lucene.document.SortedDocValuesField;
import org.apache.lucene.store.BaseDirectoryWrapper; import org.apache.lucene.store.BaseDirectoryWrapper;
import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.util.LuceneTestCase; import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.TimeUnits; 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; import com.carrotsearch.randomizedtesting.annotations.TimeoutSuite;
@SuppressCodecs({"SimpleText", "Memory", "Direct"})
@TimeoutSuite(millis = 80 * TimeUnits.HOUR) @TimeoutSuite(millis = 80 * TimeUnits.HOUR)
@Ignore("very slow") @Monster("very slow")
public class Test2BSortedDocValues extends LuceneTestCase { public class Test2BSortedDocValues extends LuceneTestCase {
// indexes Integer.MAX_VALUE docs with a fixed binary field // indexes Integer.MAX_VALUE docs with a fixed binary field

View File

@ -18,6 +18,7 @@ package org.apache.lucene.index;
*/ */
import org.apache.lucene.util.*; import org.apache.lucene.util.*;
import org.apache.lucene.util.LuceneTestCase.Monster;
import org.apache.lucene.util.LuceneTestCase.SuppressCodecs; import org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
import org.apache.lucene.store.*; import org.apache.lucene.store.*;
import org.apache.lucene.search.*; import org.apache.lucene.search.*;
@ -37,11 +38,12 @@ import java.util.Random;
// disk (but, should run successfully). Best to run w/ // disk (but, should run successfully). Best to run w/
// -Dtests.codec=<current codec>, and w/ plenty of RAM, eg: // -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 // 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" }) @SuppressCodecs({ "SimpleText", "Memory", "Direct" })
@Monster("very slow, use 8g heap")
public class Test2BTerms extends LuceneTestCase { public class Test2BTerms extends LuceneTestCase {
private final static int TOKEN_LEN = 5; 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 { public void test2BTerms() throws IOException {
System.out.println("Starting Test2B"); System.out.println("Starting Test2B");

View File

@ -24,9 +24,10 @@ import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput; import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput; import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.MockDirectoryWrapper; import org.apache.lucene.store.MockDirectoryWrapper;
import org.apache.lucene.util.LuceneTestCase.Monster;
import org.junit.Ignore; 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 class Test2BPagedBytes extends LuceneTestCase {
public void test() throws Exception { public void test() throws Exception {

View File

@ -236,6 +236,7 @@ public abstract class LuceneTestCase extends Assert {
public static final String SYSPROP_NIGHTLY = "tests.nightly"; public static final String SYSPROP_NIGHTLY = "tests.nightly";
public static final String SYSPROP_WEEKLY = "tests.weekly"; 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_AWAITSFIX = "tests.awaitsfix";
public static final String SYSPROP_SLOW = "tests.slow"; public static final String SYSPROP_SLOW = "tests.slow";
public static final String SYSPROP_BADAPPLES = "tests.badapples"; public static final String SYSPROP_BADAPPLES = "tests.badapples";
@ -264,6 +265,17 @@ public abstract class LuceneTestCase extends Assert {
@TestGroup(enabled = false, sysProperty = SYSPROP_WEEKLY) @TestGroup(enabled = false, sysProperty = SYSPROP_WEEKLY)
public @interface 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. * Annotation for tests which exhibit a known issue and are temporarily disabled.
*/ */