Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOLR-16304 De-annotate some slow tests #951

Merged
merged 33 commits into from Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
510d877
SOLR-16304 De-annotate some slow tests
madrob Jul 22, 2022
ca3831c
revert accidental inclusion
madrob Jul 22, 2022
febd9e5
fix shards to speed up non-nightly test
madrob Jul 22, 2022
49907e2
more not really slow tests
madrob Jul 23, 2022
51862b9
modules
madrob Jul 25, 2022
99534d9
no slow in solrj
madrob Jul 25, 2022
7219436
tidy
madrob Jul 25, 2022
b346693
cluster can be shared in a test class
madrob Jul 25, 2022
c14d465
revert accidental extras
madrob Jul 25, 2022
5cfca07
tidy
madrob Jul 25, 2022
40dc68f
more tests
madrob Jul 25, 2022
18b7598
slow to nightly
madrob Jul 25, 2022
0818d65
update docs to remove slow
madrob Jul 25, 2022
8260f7f
fix failing test
madrob Jul 25, 2022
f761526
revert debugging
madrob Jul 26, 2022
ff3857f
chaos tests to nightly
madrob Jul 26, 2022
c8e22ea
move work to nightly
madrob Jul 28, 2022
5c899fe
./gradlew spotlessApply
cpoerschke Jul 29, 2022
f87fe8a
remove -Dtests.slow=true in comments
cpoerschke Jul 29, 2022
d6d05e5
de-annotate some slow tests that we should feel until we fix them
madrob Jul 28, 2022
9d2b4a9
share cluster
madrob Jul 28, 2022
be0e1b6
tidy
madrob Jul 28, 2022
123b9a2
speed up wait code
madrob Jul 28, 2022
4fbd147
clarify some code
madrob Jul 29, 2022
ad1326b
precommit
madrob Jul 29, 2022
19c85bf
review feedback
madrob Jul 29, 2022
e8a9acd
more work to nightlies
madrob Jul 29, 2022
68bcc04
tidy
madrob Aug 1, 2022
8116c21
randomize for less work
madrob Aug 1, 2022
1593b2c
the rest of Slow
madrob Aug 1, 2022
2515211
rewrite loops as zk.wait
madrob Aug 1, 2022
410c368
semicolon
madrob Aug 1, 2022
b2aec5a
CHANGES
madrob Aug 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion gradle/testing/randomization.gradle
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."],
madrob marked this conversation as resolved.
Show resolved Hide resolved
[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
2 changes: 1 addition & 1 deletion help/tests.txt
Expand Up @@ -78,7 +78,7 @@ gradlew -p solr/core test -Ptests.filter=@Slow

Test group filters can be combined into Boolean expressions:

gradlew -p solr/core test "default and not(@awaitsfix or @slow)"
gradlew -p solr/core test -Ptests.filter="default and not(@awaitsfix)"


Reiteration ("beasting")
Expand Down
Expand Up @@ -20,7 +20,6 @@

import java.io.IOException;
import java.util.List;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.solr.SolrTestCaseJ4.SuppressPointFields;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrServerException;
Expand All @@ -39,7 +38,6 @@
*
* @since solr 4.0
*/
@Slow
@SuppressPointFields(bugUrl = "https://issues.apache.org/jira/browse/SOLR-10844")
public class TestDistributedGrouping extends BaseDistributedSearchTestCase {

Expand Down
2 changes: 0 additions & 2 deletions solr/core/src/test/org/apache/solr/TestRandomDVFaceting.java
Expand Up @@ -22,7 +22,6 @@
import java.util.List;
import java.util.Map;
import java.util.Random;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.lucene.tests.util.TestUtil;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.request.SolrQueryRequest;
Expand All @@ -39,7 +38,6 @@
* and compares the docvalues facet results to the indexed facet results as if it were just another
* faceting method.
*/
@Slow
@SolrTestCaseJ4.SuppressPointFields(
bugUrl = "Test explicitly compares Trie to Points, randomization defeats the point")
@SolrTestCaseJ4.SuppressSSL
Expand Down
2 changes: 0 additions & 2 deletions solr/core/src/test/org/apache/solr/TestRandomFaceting.java
Expand Up @@ -29,7 +29,6 @@
import java.util.Set;
import java.util.function.Consumer;
import java.util.regex.Pattern;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.lucene.tests.util.TestUtil;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.params.ModifiableSolrParams;
Expand All @@ -41,7 +40,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Slow
public class TestRandomFaceting extends SolrTestCaseJ4 {

private static final Pattern trieFields = Pattern.compile(".*_t.");
Expand Down
Expand Up @@ -23,7 +23,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.cloud.api.collections.ShardSplitTest;
import org.apache.solr.common.SolrInputDocument;
Expand All @@ -47,7 +46,6 @@
import org.slf4j.LoggerFactory;

/** Test split phase that occurs when a Collection API split call is made. */
@Slow
@Ignore("SOLR-4944")
public class ChaosMonkeyShardSplitTest extends ShardSplitTest {

Expand Down
Expand Up @@ -22,7 +22,6 @@
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import org.apache.commons.io.FileUtils;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.common.cloud.DocCollection;
Expand All @@ -33,7 +32,6 @@
import org.junit.BeforeClass;
import org.junit.Test;

@LuceneTestCase.Slow
public class CleanupOldIndexTest extends SolrCloudTestCase {

@BeforeClass
Expand Down Expand Up @@ -64,8 +62,7 @@ public void test() throws Exception {
// TODO make this configurable on StoppableIndexingThread
cluster.getSolrClient().setDefaultCollection(COLLECTION);

int[] maxDocList = new int[] {300, 500, 700};
int maxDoc = maxDocList[random().nextInt(maxDocList.length - 1)];
int maxDoc = atLeast(300);

StoppableIndexingThread indexThread =
new StoppableIndexingThread(null, cluster.getSolrClient(), "1", true, maxDoc, 1, true);
Expand Down Expand Up @@ -123,7 +120,7 @@ public void test() throws Exception {
TimeUnit.SECONDS,
(n, c) -> DocCollection.isFullyActive(n, c, 1, 2));

assertTrue(!oldIndexDir1.isDirectory());
assertTrue(!oldIndexDir2.isDirectory());
assertFalse(oldIndexDir1.isDirectory());
assertFalse(oldIndexDir2.isDirectory());
}
}
Expand Up @@ -18,7 +18,6 @@

import java.util.Map;
import java.util.Set;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.common.cloud.ClusterState;
Expand All @@ -30,22 +29,17 @@
import org.junit.BeforeClass;
import org.junit.Test;

@Slow
public class ClusterStateUpdateTest extends SolrCloudTestCase {

@Override
public void setUp() throws Exception {
super.setUp();
configureCluster(3).addConfig("conf", configset("cloud-minimal")).configure();
}

@BeforeClass
public static void beforeClass() {
public static void beforeClass() throws Exception {
System.setProperty("solrcloud.skip.autorecovery", "true");
configureCluster(3).addConfig("conf", configset("cloud-minimal")).configure();
}

@AfterClass
public static void afterClass() {
public static void afterClass() throws Exception {
shutdownCluster();
System.clearProperty("solrcloud.skip.autorecovery");
System.clearProperty("genericCoreNodeNames");
}
Expand Down
Expand Up @@ -28,7 +28,6 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.client.solrj.response.CollectionAdminResponse;
Expand All @@ -42,7 +41,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@LuceneTestCase.Slow
@SolrTestCaseJ4.SuppressSSL
public class CollectionPropsTest extends SolrCloudTestCase {
private static final int TIMEOUT = 5000;
Expand Down
Expand Up @@ -37,7 +37,6 @@
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.apache.lucene.tests.util.TestUtil;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrRequest;
Expand Down Expand Up @@ -69,28 +68,27 @@
import org.apache.solr.common.util.TimeSource;
import org.apache.solr.common.util.Utils;
import org.apache.solr.util.TimeOut;
import org.junit.After;
import org.junit.Before;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@LuceneTestCase.Slow
public class CollectionsAPISolrJTest extends SolrCloudTestCase {
private static final int TIMEOUT = 3000;
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

@Before
public void beforeTest() throws Exception {
@BeforeClass
public static void beforeTest() throws Exception {
// System.setProperty("metricsEnabled", "true");
configureCluster(4)
.addConfig("conf", configset("cloud-minimal"))
.addConfig("conf2", configset("cloud-dynamic"))
.configure();
}

@After
public void afterTest() throws Exception {
@AfterClass
public static void afterTest() throws Exception {
shutdownCluster();
}

Expand All @@ -99,7 +97,7 @@ public void afterTest() throws Exception {
*/
@Test
public void testCreateWithDefaultConfigSet() throws Exception {
String collectionName = "solrj_default_configset";
String collectionName = getSaferTestName();
CollectionAdminResponse response =
CollectionAdminRequest.createCollection(collectionName, 2, 2)
.setPerReplicaState(SolrCloudTestCase.USE_PER_REPLICA_STATE)
Expand Down Expand Up @@ -347,7 +345,7 @@ public void testCreateCollWithDefaultClusterPropertiesNewFormat() throws Excepti

@Test
public void testCreateAndDeleteCollection() throws Exception {
String collectionName = "solrj_test";
String collectionName = getSaferTestName();
CollectionAdminResponse response =
CollectionAdminRequest.createCollection(collectionName, "conf", 2, 2)
.process(cluster.getSolrClient());
Expand Down Expand Up @@ -392,7 +390,7 @@ public void testCreateAndDeleteCollection() throws Exception {

@Test
public void testCloudInfoInCoreStatus() throws IOException, SolrServerException {
String collectionName = "corestatus_test";
String collectionName = getSaferTestName();
CollectionAdminResponse response =
CollectionAdminRequest.createCollection(collectionName, "conf", 2, 2)
.process(cluster.getSolrClient());
Expand Down Expand Up @@ -492,8 +490,7 @@ public void testCreateAndDeleteAlias() throws IOException, SolrServerException {

@Test
public void testSplitShard() throws Exception {

final String collectionName = "solrj_test_splitshard";
String collectionName = getSaferTestName();
CollectionAdminRequest.createCollection(collectionName, "conf", 2, 1)
.setPerReplicaState(SolrCloudTestCase.USE_PER_REPLICA_STATE)
.process(cluster.getSolrClient());
Expand Down Expand Up @@ -546,8 +543,7 @@ public void testSplitShard() throws Exception {

@Test
public void testCreateCollectionWithPropertyParam() throws Exception {

String collectionName = "solrj_test_core_props";
String collectionName = getSaferTestName();

Path tmpDir = createTempDir("testPropertyParamsForCreate");
Path dataDir = tmpDir.resolve("dataDir-" + TestUtil.randomSimpleString(random(), 1, 5));
Expand Down Expand Up @@ -579,8 +575,7 @@ public void testCreateCollectionWithPropertyParam() throws Exception {

@Test
public void testAddAndDeleteReplica() throws Exception {

final String collectionName = "solrj_replicatests";
String collectionName = getSaferTestName();
CollectionAdminRequest.createCollection(collectionName, "conf", 1, 2)
.setPerReplicaState(SolrCloudTestCase.USE_PER_REPLICA_STATE)
.process(cluster.getSolrClient());
Expand Down Expand Up @@ -663,7 +658,7 @@ public void testClusterProp() throws IOException, SolrServerException {

@Test
public void testCollectionProp() throws InterruptedException, IOException, SolrServerException {
final String collectionName = "collectionPropTest";
String collectionName = getSaferTestName();
final String propName = "testProperty";

CollectionAdminRequest.createCollection(collectionName, "conf", 2, 2)
Expand Down Expand Up @@ -700,7 +695,7 @@ private void checkCollectionProperty(String collection, String propertyName, Str

@Test
public void testColStatus() throws Exception {
final String collectionName = "collectionStatusTest";
String collectionName = getSaferTestName();
CollectionAdminRequest.createCollection(collectionName, "conf2", 2, 2)
.setPerReplicaState(SolrCloudTestCase.USE_PER_REPLICA_STATE)
.process(cluster.getSolrClient());
Expand Down Expand Up @@ -831,7 +826,7 @@ public void testColStatusCollectionName() throws Exception {

@Test
public void testReadOnlyCollection() throws Exception {
final String collectionName = "readOnlyTest";
String collectionName = getSaferTestName();
CloudSolrClient solrClient = cluster.getSolrClient();

CollectionAdminRequest.createCollection(collectionName, "conf", 2, 2).process(solrClient);
Expand Down
Expand Up @@ -30,7 +30,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@LuceneTestCase.Slow
@LuceneTestCase.AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-12386")
public class ConcurrentCreateRoutedAliasTest extends SolrTestCaseJ4 {

Expand Down
Expand Up @@ -21,7 +21,6 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeoutException;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.cloud.ConnectionManager;
import org.apache.solr.common.cloud.SolrZkClient;
Expand All @@ -35,7 +34,6 @@
import org.junit.Ignore;
import org.junit.Test;

@Slow
public class ConnectionManagerTest extends SolrTestCaseJ4 {

static final int TIMEOUT = 3000;
Expand Down
Expand Up @@ -111,7 +111,8 @@ public void multipleShardMigrateTest() throws Exception {

final String splitKey = "a";
final int BIT_SEP = 1;
final int[] splitKeyCount = new int[1];
int splitKeyCount = 0;
;
madrob marked this conversation as resolved.
Show resolved Hide resolved
for (int id = 0; id < 26 * 3; id++) {
String shardKey =
"" + (char) ('a' + (id % 26)); // See comment in ShardRoutingTest for hash distribution
Expand All @@ -123,9 +124,9 @@ public void multipleShardMigrateTest() throws Exception {
doc.addField("id", key + "!" + id);
doc.addField("n_ti", id);
cluster.getSolrClient().add("sourceCollection", doc);
if (splitKey.equals(shardKey)) splitKeyCount[0]++;
if (splitKey.equals(shardKey)) splitKeyCount++;
}
assertTrue(splitKeyCount[0] > 0);
assertTrue(splitKeyCount > 0);

String targetCollection = "migrate_multipleshardtest_targetCollection";
CollectionAdminRequest.createCollection(targetCollection, "conf", 1, 1)
Expand All @@ -152,11 +153,11 @@ public void multipleShardMigrateTest() throws Exception {
long finishTime = System.nanoTime();

indexer.join();
splitKeyCount[0] += indexer.getSplitKeyCount();
splitKeyCount += indexer.getSplitKeyCount();

try {
cluster.getSolrClient().deleteById("a/" + BIT_SEP + "!104");
splitKeyCount[0]--;
splitKeyCount--;
} catch (Exception e) {
log.warn("Error deleting document a/{}!104", BIT_SEP, e);
}
Expand All @@ -168,7 +169,7 @@ public void multipleShardMigrateTest() throws Exception {
log.info("Response from target collection: {}", response);
assertEquals(
"DocCount on target collection does not match",
splitKeyCount[0],
splitKeyCount,
response.getResults().getNumFound());

waitForState(
Expand Down
Expand Up @@ -22,7 +22,6 @@
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.List;
import org.apache.lucene.tests.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.embedded.JettySolrRunner;
Expand All @@ -38,7 +37,6 @@
import org.junit.BeforeClass;
import org.junit.Test;

@Slow
public class MissingSegmentRecoveryTest extends SolrCloudTestCase {
final String collection = getClass().getSimpleName();

Expand Down