dsmiley commented on code in PR #2751:
URL: https://github.com/apache/solr/pull/2751#discussion_r1797604770
##########
solr/solrj-zookeeper/src/test/org/apache/solr/client/solrj/impl/NodeValueFetcherTest.java:
##########
@@ -62,28 +64,32 @@ public void cleanup() throws Exception {
}
@Test
- public void testGetTags() {
-
- CloudLegacySolrClient solrClient = (CloudLegacySolrClient)
cluster.getSolrClient();
- int totalCores = 0;
-
- // Sum all the cores of the collection by fetching tags of all nodes.
- // We should get same number than when we created the collection
- for (JettySolrRunner runner : cluster.getJettySolrRunners()) {
- String node = runner.getNodeName();
- RemoteCallCtx ctx = new RemoteCallCtx(node, solrClient);
- NodeValueFetcher fetcher = new NodeValueFetcher();
-
- Set<String> requestedTags = Set.of("cores");
- fetcher.getTags(requestedTags, ctx);
-
- // make sure we only get the tag we asked
- assertEquals(1, ctx.tags.size());
-
- int coresOnNode = (Integer) ctx.tags.get("cores");
- totalCores += coresOnNode;
+ public void testGetTags() throws Exception {
+ try (var cloudHttp2SolrClient =
+ new CloudHttp2SolrClient.Builder(
+
Collections.singletonList(cluster.getZkServer().getZkAddress()),
Optional.empty())
+ .build()) {
+ int totalCores = 0;
+
+ // Sum all the cores of the collection by fetching tags of all nodes.
+ // We should get same number than when we created the collection
+ for (JettySolrRunner runner : cluster.getJettySolrRunners()) {
+ String node = runner.getNodeName();
+ RemoteCallCtx ctx =
+ new RemoteCallCtx(node, cloudHttp2SolrClient,
cloudHttp2SolrClient.getHttpClient());
Review Comment:
This is highly suspicious; why would any object need two types of
SolrClients?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]