Skip to content

Apache Lucene open-source search software

SOLR-7384: Fix spurious failures in FullSolrCloudDistribCmdsTest

Shalin Shekhar Mangar4a4d96600a38
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 79385dc9a36..b6bfeabcede 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -126,6 +126,8 @@ Other Changes
* SOLR-7381: Improve logging by adding node name in MDC in SolrCloud mode and adding MDC to
all thread pools. (shalin)
+* SOLR-7384: Fix spurious failures in FullSolrCloudDistribCmdsTest. (shalin)
+
================== 5.1.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release
diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
index 38718736ab5..2a89ab12f40 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandler.java
@@ -178,8 +178,6 @@ public class HttpShardHandler extends ShardHandler {
public void submit(final ShardRequest sreq, final String shard, final ModifiableSolrParams params) {
// do this outside of the callable for thread safety reasons
final List<String> urls = getURLs(sreq, shard);
- if (Strings.isNullOrEmpty(shard))
- System.out.println("Empty shard!");
Callable<ShardResponse> task = new Callable<ShardResponse>() {
@Override
diff --git a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
index 279b4a70d08..9f02ccd8c3d 100644
--- a/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
@@ -175,6 +175,8 @@ public class FullSolrCloudDistribCmdsTest extends AbstractFullDistribZkTestBase
assertTrue(status.get("QTime") > 0);
}
+ waitForRecoveriesToFinish("implicit_collection_without_routerfield", true);
+
SolrClient shard1 = createNewSolrClient("implicit_collection_without_routerfield_shard1_replica1",
getBaseUrl((HttpSolrClient) clients.get(0)));
SolrClient shard2 = createNewSolrClient("implicit_collection_without_routerfield_shard2_replica1",
@@ -302,6 +304,8 @@ public class FullSolrCloudDistribCmdsTest extends AbstractFullDistribZkTestBase
assertTrue(status.get("QTime") > 0);
}
+ waitForRecoveriesToFinish("compositeid_collection_with_routerfield", true);
+
SolrClient shard1 = createNewSolrClient("compositeid_collection_with_routerfield_shard1_replica1",
getBaseUrl((HttpSolrClient) clients.get(0)));
SolrClient shard2 = createNewSolrClient("compositeid_collection_with_routerfield_shard2_replica1",