Skip to content

Commit

Permalink
SOLR-16784 Frequent failing CollectionReloadTest (#1662)
Browse files Browse the repository at this point in the history
* SOLR-16784 Frequent failing CollectionReloadTest

* enabling random selection in TestPullReplica
  • Loading branch information
stillalex committed May 25, 2023
1 parent 00a5cb5 commit f6de836
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void tearDown() throws Exception {
@Repeat(iterations = 30)
public void testCreateDelete() throws Exception {
try {
switch (2 /*random().nextInt(3)*/) {
switch (random().nextInt(3)) {
case 0:
// Sometimes use SolrJ
CollectionAdminRequest.createCollection(collectionName, "conf", 2, 1, 0, 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.lucene.tests.util.LuceneTestCase.BadApple;
import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.impl.CloudLegacySolrClient;
Expand All @@ -35,15 +34,12 @@
import org.apache.solr.common.cloud.Replica;
import org.apache.solr.common.util.RetryUtil;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** Verifies cluster state remains consistent after collection reload. */
@SuppressSSL(bugUrl = "https://issues.apache.org/jira/browse/SOLR-5776")
@BadApple(bugUrl = "https://issues.apache.org/jira/browse/SOLR-16784")
@Ignore
public class CollectionReloadTest extends SolrCloudTestCase {

private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
Expand Down Expand Up @@ -180,15 +176,14 @@ private void createCollection(
case 2:
log.info("Creating collection with V2 API");
// Sometimes use V2 API
url = cluster.getRandomJetty(random()).getBaseUrl().toString() + "/____v2/c";
url = cluster.getRandomJetty(random()).getBaseUrl().toString() + "/____v2/collections";
String requestBody =
String.format(
Locale.ROOT,
"{create:{name:%s, config:%s, numShards:%s, maxShardsPerNode:%s, nrtReplicas:%s, tlogReplicas:%s, pullReplicas:%s}}",
"{\"name\":\"%s\", \"config\":\"%s\", \"numShards\":%s, \"nrtReplicas\":%s, \"tlogReplicas\":%s, \"pullReplicas\":%s}",
collectionName,
"conf",
numShards, // numShards
100, // maxShardsPerNode
nrtReplicas,
tlogReplicas,
pullReplicas);
Expand Down

0 comments on commit f6de836

Please sign in to comment.