dsmiley commented on code in PR #1211:
URL: https://github.com/apache/solr/pull/1211#discussion_r1039832255


##########
solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java:
##########
@@ -116,8 +116,10 @@ public void testNoUrlAccess() throws Exception {
     SolrQuery query = new SolrQuery();
     query.setQuery("*:*"); // for anything
     query.add("stream.url", makeDeleteAllUrl());
-    SolrException se = expectThrows(SolrException.class, () -> 
getSolrClient().query(query));
-    assertSame(ErrorCode.BAD_REQUEST, ErrorCode.getErrorCode(se.code()));
+    try (SolrClient solrClient = getHttpSolrClient(getServerUrl())) {

Review Comment:
   If you have a *new* SolrClient, then yes -- we should use 
try-with-resources.  Ideally any utility methods that create a new one would 
have "create" or "new" in their name; alas this isn't true.  If you have some 
SolrClient managed by test infrastructure somehow, then there we shouldn't 
close it.  I don't think we should mandate either path.



-- 
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]

Reply via email to