You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ho...@apache.org on 2024/01/13 16:07:27 UTC

(lucene-solr) branch branch_8_11 updated: SOLR-17098: Fix some test issues

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

houston pushed a commit to branch branch_8_11
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8_11 by this push:
     new f13b6738b5b SOLR-17098: Fix some test issues
f13b6738b5b is described below

commit f13b6738b5b8888023dc760801b9436ee30429c5
Author: Houston Putman <ho...@apache.org>
AuthorDate: Fri Jan 12 16:47:36 2024 -0600

    SOLR-17098: Fix some test issues
---
 .../src/java/org/apache/solr/client/solrj/io/SolrClientCache.java  | 2 +-
 solr/solrj/src/test-files/solrj/solr/solr.xml                      | 1 -
 .../test/org/apache/solr/client/solrj/io/SolrClientCacheTest.java  | 7 ++++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java
index 5b6b34f2441..d27808bf14d 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java
@@ -103,8 +103,8 @@ public class SolrClientCache implements Serializable {
       }
 
       client = builder.build();
-      client.connect();
       solrClients.put(zkHost, client);
+      client.connect();
     }
 
     return client;
diff --git a/solr/solrj/src/test-files/solrj/solr/solr.xml b/solr/solrj/src/test-files/solrj/solr/solr.xml
index 323ebc3f5b2..5bbc3d6a3da 100644
--- a/solr/solrj/src/test-files/solrj/solr/solr.xml
+++ b/solr/solrj/src/test-files/solrj/solr/solr.xml
@@ -44,7 +44,6 @@
     <int name="distribUpdateSoTimeout">${distribUpdateSoTimeout:340000}</int>
     <str name="zkCredentialsProvider">${zkCredentialsProvider:org.apache.solr.common.cloud.DefaultZkCredentialsProvider}</str>
     <str name="zkACLProvider">${zkACLProvider:org.apache.solr.common.cloud.DefaultZkACLProvider}</str>
-    <str name="zkCredentialsInjector">${zkCredentialsInjector:org.apache.solr.common.cloud.DefaultZkCredentialsInjector}</str>
   </solrcloud>
 
 </solr>
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/SolrClientCacheTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/SolrClientCacheTest.java
index 66eedcc192f..a3e7be8804f 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/SolrClientCacheTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/SolrClientCacheTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.solr.client.solrj.io;
 
+import java.io.IOException;
 import java.util.Map;
 
 import com.google.common.collect.ImmutableMap;
@@ -61,19 +62,19 @@ public class SolrClientCacheTest extends SolrCloudTestCase {
       // This ZK Host is fake, thus the ZK ACLs should not be used
       cache.setDefaultZKHost("test:2181");
       expectThrows(
-          SolrException.class, () -> cache.getCloudSolrClient(zkClient().getZkServerAddress()));
+          SolrException.class, () -> cache.getCloudSolrClient(zkClient().getZkServerAddress()).close());
     } finally {
       cache.close();
     }
   }
 
   @Test
-  public void testZkACLsUsedWithDifferentChroot() {
+  public void testZkACLsUsedWithDifferentChroot() throws IOException {
     SolrClientCache cache = new SolrClientCache();
     try {
       // The same ZK Host is used, so the ZK ACLs should still be applied
       cache.setDefaultZKHost(zkClient().getZkServerAddress() + "/random/chroot");
-      cache.getCloudSolrClient(zkClient().getZkServerAddress());
+      cache.getCloudSolrClient(zkClient().getZkServerAddress()).close();
     } finally {
       cache.close();
     }