epugh commented on code in PR #1211:
URL: https://github.com/apache/solr/pull/1211#discussion_r1039646202
##########
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:
so, there was a discussion that we should always use the try/with resources
pattern with SolrClient... So I moved in the direction, with maybe the idea
that the SolrJettyTestBase.getSolrClient() might go away, because we would
always create our own and then close it, instead of having the base test class
provide one and be responsible for it...
There is the createNewSolrClient method, so I am swapping to that.
We do need a better policy, ideally written down and/or code checked on if
we use base classes to manage lifecycle of SolrClient in tests or do the
try/with resources...
--
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]