stillalex commented on code in PR #1565:
URL: https://github.com/apache/solr/pull/1565#discussion_r1178102320


##########
solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpSolrClientBuilderTest.java:
##########
@@ -51,6 +52,22 @@ public void testProvidesHttpClientToClient() throws 
IOException {
     }
   }
 
+  @AwaitsFix(bugUrl = "https://issues.apache.org/jira/browse/SOLR-13605";)
+  @Test
+  public void testUsesTimeoutProvidedByHttpClient() throws IOException {
+
+    ModifiableSolrParams clientParams = new ModifiableSolrParams();
+    clientParams.set(HttpClientUtil.PROP_SO_TIMEOUT, 12345);
+    clientParams.set(HttpClientUtil.PROP_CONNECTION_TIMEOUT, 67890);
+    HttpClient httpClient = HttpClientUtil.createClient(clientParams);
+    try (HttpSolrClient createdClient =
+        new Builder(ANY_BASE_SOLR_URL).withHttpClient(httpClient).build()) {
+      assertEquals(createdClient.getHttpClient(), httpClient);
+      assertEquals(67890, createdClient.getConnectionTimeout());
+      assertEquals(12345, createdClient.getSocketTimeout());
+    }
+  }

Review Comment:
   interesting. HttpClient does not seem to implement AutoCloseable so you 
would not be able to do it like this. had no idea



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to