Skip to content

Commit

Permalink
LUCENE-10532: remove @Slow annotation (apache#832)
Browse files Browse the repository at this point in the history
Remove `@Slow` annotation, for more consistency with CI and local jobs. All tests can be fast!
  • Loading branch information
rmuir authored May 10, 2022
1 parent 111d6b1 commit 3edfeb5
Show file tree
Hide file tree
Showing 40 changed files with 9 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ jobs:
run: cat gradle.properties

- name: Run gradle tests
run: ./gradlew test "-Ptask.times=true" "-Ptests.slow=false" --max-workers 2
run: ./gradlew test "-Ptask.times=true" --max-workers 2

# - uses: gradle/wrapper-validation-action@v1
4 changes: 2 additions & 2 deletions dev-tools/scripts/reproduceJenkinsFailures.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
reAntInvocation = re.compile(r'\bant(?:\.bat)?\s+.*(?:jenkins-(?:hourly|nightly)|nightly-smoke)')
reAntSysprops = re.compile(r'"-D[^"]+"|-D[^=]+="[^"]*"|-D\S+')

# Method example: NOTE: reproduce with: ant test -Dtestcase=ZkSolrClientTest -Dtests.method=testMultipleWatchesAsync -Dtests.seed=6EF5AB70F0032849 -Dtests.slow=true -Dtests.locale=he-IL -Dtests.timezone=NST -Dtests.asserts=true -Dtests.file.encoding=UTF-8
# Suite example: NOTE: reproduce with: ant test -Dtestcase=CloudSolrClientTest -Dtests.seed=DB2DF2D8228BAF27 -Dtests.multiplier=3 -Dtests.slow=true -Dtests.locale=es-AR -Dtests.timezone=America/Argentina/Cordoba -Dtests.asserts=true -Dtests.file.encoding=US-ASCII
# Method example: NOTE: reproduce with: ant test -Dtestcase=ZkSolrClientTest -Dtests.method=testMultipleWatchesAsync -Dtests.seed=6EF5AB70F0032849 -Dtests.locale=he-IL -Dtests.timezone=NST -Dtests.asserts=true -Dtests.file.encoding=UTF-8
# Suite example: NOTE: reproduce with: ant test -Dtestcase=CloudSolrClientTest -Dtests.seed=DB2DF2D8228BAF27 -Dtests.multiplier=3 -Dtests.locale=es-AR -Dtests.timezone=America/Argentina/Cordoba -Dtests.asserts=true -Dtests.file.encoding=US-ASCII
reReproLine = re.compile(r'NOTE:\s+reproduce\s+with:(\s+ant\s+test\s+-Dtestcase=(\S+)\s+(?:-Dtests.method=\S+\s+)?(.*))')
reTestsSeed = re.compile(r'-Dtests.seed=\S+\s*')

Expand Down
1 change: 0 additions & 1 deletion gradle/testing/randomization.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ allprojects {
[propName: 'tests.timezone', value: "random", description: "Sets the default time zone tests should run with."],
// filtering
[propName: 'tests.filter', value: null, description: "Applies a test filter (see :helpTests)."],
[propName: 'tests.slow', value: true, description: "Enables or disables @Slow tests."],
[propName: 'tests.nightly', value: false, description: "Enables or disables @Nightly tests."],
[propName: 'tests.weekly', value: false, description: "Enables or disables @Weekly tests."],
[propName: 'tests.monster', value: false, description: "Enables or disables @Monster tests."],
Expand Down
8 changes: 4 additions & 4 deletions help/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ Test groups
-----------

Tests can be filtered by an annotation they're marked with.
Some test group annotations include: @AwaitsFix, @Nightly, @Slow
Some test group annotations include: @AwaitsFix, @Nightly

This uses filtering infrastructure on the *runner* (randomizedtesting),
not gradle's built-in mechanisms (but it can be combined with "--tests").
For example, run all lucene-core tests annotated as @Slow:
For example, run all lucene-core tests annotated as @Nightly:

gradlew -p lucene/core test -Ptests.filter=@Slow
gradlew -p lucene/core test -Ptests.filter=@Nightly

Test group filters can be combined into Boolean expressions:

gradlew -p lucene/core test "default and not(@awaitsfix or @slow)"
gradlew -p lucene/core test "default and not(@awaitsfix or @nightly)"


Reiteration ("beasting")
Expand Down
2 changes: 2 additions & 0 deletions lucene/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ Build

* Upgrade forbiddenapis to version 3.3. (Uwe Schindler)

* LUCENE-10532: Remove LuceneTestCase.Slow annotation. ALl tests can be fast. (Robert Muir)

Other
---------------------
* LUCENE-10526: Test-framework: Add FilterFileSystemProvider.wrapPath(Path) method for mock filesystems
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ public void testRandomStrings() throws Exception {
}

/** blast some random large strings through the analyzer */
@Slow
public void testRandomHugeStrings() throws Exception {
Random random = random();
checkRandomData(random, analyzer, RANDOM_MULTIPLIER, 4096);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public void testPutException() {
}

/** enumerates the entire FST/lookup data and just does basic sanity checks */
@Slow
public void testEnumerateAll() throws Exception {
// just for debugging
int numTerms = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public void testSortedSetVariableLengthManyVsStoredFields() throws Exception {
}
}

@Slow
public void testSortedVariableLengthBigVsStoredFields() throws Exception {
int numIterations = atLeast(1);
for (int i = 0; i < numIterations; i++) {
Expand Down Expand Up @@ -153,7 +152,6 @@ public void testTermsEnumLongSharedPrefixes() throws Exception {
}
}

@Slow
public void testSparseDocValuesVsStoredFields() throws Exception {
int numIterations = atLeast(1);
for (int i = 0; i < numIterations; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ protected TokenStreamComponents createComponents(String fieldName) {
}

@Test
@Slow
public void testPerformance() throws Exception {
MockAnalyzer analyzer = new MockAnalyzer(random());
int numDocs = atLeast(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class TestStandardAnalyzer extends BaseTokenStreamTestCase {

// LUCENE-5897: slow tokenization of strings of the form
// (\p{WB:ExtendNumLet}[\p{WB:Format}\p{WB:Extend}]*)+
@Slow
public void testLargePartiallyMatchingToken() throws Exception {
// TODO: get these lists of chars matching a property from ICU4J
// http://www.unicode.org/Public/6.3.0/ucd/auxiliary/WordBreakProperty.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public void testSetLength() {
});
}

@Slow
public void testGrow() {
CharTermAttributeImpl t = new CharTermAttributeImpl();
StringBuilder buf = new StringBuilder("ab");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public void testSortedSetVariableLengthManyVsStoredFields() throws Exception {
}
}

@Slow
public void testSortedVariableLengthBigVsStoredFields() throws Exception {
int numIterations = atLeast(1);
for (int i = 0; i < numIterations; i++) {
Expand Down Expand Up @@ -161,7 +160,6 @@ public void testTermsEnumLongSharedPrefixes() throws Exception {
}
}

@Slow
public void testSparseDocValuesVsStoredFields() throws Exception {
int numIterations = atLeast(1);
for (int i = 0; i < numIterations; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public void testSameShapeManyTimes() throws Exception {
}

// Force low cardinality leaves
@Slow
public void testLowCardinalityShapeManyTimes() throws Exception {
int numShapes = atLeast(20);
int cardinality = TestUtil.nextInt(random(), 2, 20);
Expand All @@ -105,12 +104,10 @@ public void testRandomTiny() throws Exception {
doTestRandom(10);
}

@Slow
public void testRandomMedium() throws Exception {
doTestRandom(atLeast(20));
}

@Slow
@Nightly
public void testRandomBig() throws Exception {
doTestRandom(20000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public boolean testComponentQuery(Component2D query, Object shape) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public boolean testComponentQuery(Component2D query, Object shape) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public boolean testComponentQuery(Component2D query, Object shape) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public boolean testComponentQuery(Component2D query, Object shape) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public boolean testComponentQuery(Component2D query, Object shape) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ private boolean testWithinPolygon(Component2D query, Polygon[] polygons) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public boolean testComponentQuery(Component2D query, Object shape) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public boolean testComponentQuery(Component2D query, Object shape) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public boolean testComponentQuery(Component2D query, Object shape) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ private boolean testWithinPolygon(Component2D query, XYPolygon[] polygons) {
}
}

@Slow
@Nightly
@Override
public void testRandomBig() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@
import org.apache.lucene.tests.index.RandomIndexWriter;
import org.apache.lucene.tests.util.LineFileDocs;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.lucene.tests.util.TestUtil;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;

/** Compares one codec against another */
@Slow
public class TestDuelingCodecs extends LuceneTestCase {
Directory leftDir;
IndexReader leftReader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ public void testSetMaxMergeDocs() throws IOException {
dir.close();
}

@Slow
public void testNoWaitClose() throws Throwable {
Directory directory = newDirectory();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ public void testDeleteFromIndexWriter() throws Exception {
dir1.close();
}

@Slow
public void testAddIndexesAndDoDeletesThreads() throws Throwable {
final int numIter = TEST_NIGHTLY ? 2 : 1;
int numDirs = TEST_NIGHTLY ? 3 : 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@
import org.apache.lucene.tests.store.MockDirectoryWrapper;
import org.apache.lucene.tests.util.LineFileDocs;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.lucene.tests.util.TestUtil;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.ThreadInterruptedException;

/** MultiThreaded IndexWriter tests */
@Slow
@LuceneTestCase.SuppressCodecs("SimpleText")
public class TestIndexWriterWithThreads extends LuceneTestCase {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ private Integer[] createSparseRandomArray(int maxSize) {

// This is a test for LUCENE-3054 (which fails without the merge sort fall back with stack
// overflow in most cases)
@Slow
public void testQuickToHeapSortFallback() {
int num = atLeast(10);
for (int i = 0; i < num; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ private ExecutorService randomExecutorServiceOrNull() {
}
}

@Slow
public void testIntermediateMerges() throws Exception {
// Sort 20 mb worth of data with 1mb buffer, binary merging.
try (Directory dir = newFSDirectory(createTempDir())) {
Expand All @@ -115,7 +114,6 @@ public void testIntermediateMerges() throws Exception {
}
}

@Slow
public void testSmallRandom() throws Exception {
// Sort 20 mb worth of data with 1mb buffer.
try (Directory dir = newFSDirectory(createTempDir())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ public void testBigSet() throws IOException {

// Build FST for all unique terms in the test line docs
// file, up until a doc limit
@Slow
public void testRealTerms() throws Exception {

final LineFileDocs docs = new LineFileDocs(random());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1420,15 +1420,13 @@ public void testEquals_numericJoin() throws Exception {
}

@Test
@Slow
public void testSingleValueRandomJoin() throws Exception {
int maxIndexIter = atLeast(1);
int maxSearchIter = atLeast(1);
executeRandomJoin(false, maxIndexIter, maxSearchIter, TestUtil.nextInt(random(), 87, 764));
}

@Test
@Slow
// This test really takes more time, that is why the number of iterations are smaller.
public void testMultiValueRandomJoin() throws Exception {
int maxIndexIter = atLeast(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,6 @@ public void run() {
}
}

@Slow
public void testRandomNRT() throws Exception {
final Path tempDir = createTempDir("AnalyzingInfixSuggesterTest");
Analyzer a = new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@ public TokenStreamComponents createComponents(String fieldName) {

private static char SEP = '\u001F';

@Slow
public void testRandom() throws Exception {

int numQueries = atLeast(200);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ public TokenStreamComponents createComponents(String fieldName) {
}
}

@Slow
public void testRandom() throws Exception {

int numQueries = atLeast(20);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ public void testTokenStream() throws Exception {
}

@Test
@Slow
public void testDupSuggestFieldValues() throws Exception {
Analyzer analyzer = new MockAnalyzer(random());
RandomIndexWriter iw =
Expand Down Expand Up @@ -282,7 +281,6 @@ public void testDeduplication() throws Exception {
iw.close();
}

@Slow
public void testExtremeDeduplication() throws Exception {
Analyzer analyzer = new MockAnalyzer(random());
RandomIndexWriter iw =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ public void testLargeInputConstantWeights() throws Exception {
tempDir.close();
}

@Slow
public void testMultilingualInput() throws Exception {
List<Input> input = TestLookupBenchmark.readTop50KWiki();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ public IndexOutput createOutput(String name, IOContext context) throws IOExcepti
}

// LUCENE-5724: actually test we play nice with NRTCachingDir and massive file
@Slow
public void testLargeCFS() throws IOException {
final String testfile = "_123.test";
IOContext context = new IOContext(new FlushInfo(0, 512 * 1024 * 1024));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ public void testHighFreqs() throws IOException {
}
}

@Slow
public void testLotsOfFields() throws IOException {
int fieldCount = TEST_NIGHTLY ? atLeast(100) : atLeast(10);
final RandomDocumentFactory docFactory = new RandomDocumentFactory(fieldCount, 10);
Expand Down
Loading

0 comments on commit 3edfeb5

Please sign in to comment.