Skip to content

Apache Lucene open-source search software

SOLR-11638: Fix CloudSolrClientTest periodic failures after SOLR-11507

Shalin Shekhar Mangar304534914099
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 6c8dab7741f..d151353e939 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -157,7 +157,8 @@ Other Changes
* SOLR-10469: Move CloudSolrClient.setParallelUpdates to its Builder. (David Smiley)
-* SOLR-11507: Randomize SolrTestCaseJ4.CloudSolrClientBuilder more, and simplify it. (David Smiley)
+* SOLR-11507: SOLR-11638: Randomize SolrTestCaseJ4.CloudSolrClientBuilder more, and simplify it.
+ (Jason Gerlowski, David Smiley)
================== 7.1.0 ==================
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientTest.java
index ffe59cff99d..c0580ed674c 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientTest.java
@@ -812,7 +812,11 @@ public class CloudSolrClientTest extends SolrCloudTestCase {
final String old_leader_core_node_name = slice.getLeader().getName();
// NOTE: creating our own CloudSolrClient whose settings we can muck with...
- try (CloudSolrClient stale_client = getCloudSolrClient(cluster.getZkServer().getZkAddress())) {
+ try (CloudSolrClient stale_client = new CloudSolrClientBuilder()
+ .withZkHost(cluster.getZkServer().getZkAddress())
+ .sendDirectUpdatesToAnyShardReplica()
+ .withParallelUpdates(true)
+ .build()) {
// don't let collection cache entries get expired, even on a slow machine...
stale_client.setCollectionCacheTTl(Integer.MAX_VALUE);
stale_client.setDefaultCollection(COL);