Skip to content

Commit

Permalink
SOLR-17098: Fix some test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
HoustonPutman committed Jan 12, 2024
1 parent 61c956c commit f13b673
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ public synchronized CloudSolrClient getCloudSolrClient(String zkHost) {
}

client = builder.build();
client.connect();
solrClients.put(zkHost, client);
client.connect();
}

return client;
Expand Down
1 change: 0 additions & 1 deletion solr/solrj/src/test-files/solrj/solr/solr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -61,19 +62,19 @@ public void testZkACLsNotUsedWithDifferentZkHost() {
// 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();
}
Expand Down

0 comments on commit f13b673

Please sign in to comment.