You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2023/05/25 17:05:15 UTC

[solr] branch branch_9x updated: SOLR-16784 Frequent failing CollectionReloadTest (#1662)

This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new 9dd3a51b0d3 SOLR-16784 Frequent failing CollectionReloadTest (#1662)
9dd3a51b0d3 is described below

commit 9dd3a51b0d3f5d63dabb44e01cdac800fa685c0c
Author: Alex <st...@apache.org>
AuthorDate: Thu May 25 10:04:24 2023 -0700

    SOLR-16784 Frequent failing CollectionReloadTest (#1662)
    
    * SOLR-16784 Frequent failing CollectionReloadTest
    
    * enabling random selection in TestPullReplica
---
 solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java    | 2 +-
 .../apache/solr/cloud/api/collections/CollectionReloadTest.java  | 9 ++-------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java
index baaab3d516f..6bc17396b33 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestPullReplica.java
@@ -128,7 +128,7 @@ public class TestPullReplica extends SolrCloudTestCase {
   @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)
diff --git a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionReloadTest.java b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionReloadTest.java
index 3b2baef2d6f..a6c961f5820 100644
--- a/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionReloadTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/api/collections/CollectionReloadTest.java
@@ -25,7 +25,6 @@ import org.apache.http.HttpResponse;
 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;
@@ -35,15 +34,12 @@ import org.apache.solr.cloud.SolrCloudTestCase;
 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());
@@ -180,15 +176,14 @@ public class CollectionReloadTest extends SolrCloudTestCase {
       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);