harishch1998 commented on code in PR #10053:
URL: https://github.com/apache/iceberg/pull/10053#discussion_r1554368145


##########
core/src/test/java/org/apache/iceberg/rest/TestHTTPClient.java:
##########
@@ -133,6 +136,59 @@ public void testDynamicHttpRequestInterceptorLoading() {
     assertThat(((TestHttpRequestInterceptor) 
interceptor).properties).isEqualTo(properties);
   }
 
+  @Test
+  public void testHttpClientGetConnectionConfig() {
+    long connectionTimeoutMs = 10L;
+    int socketTimeoutMs = 10;
+    Map<String, String> properties =
+        ImmutableMap.of(
+            HTTPClient.REST_CONNECTION_TIMEOUT_MS, 
String.valueOf(connectionTimeoutMs),
+            HTTPClient.REST_SOCKET_TIMEOUT_MS, 
String.valueOf(socketTimeoutMs));
+
+    ConnectionConfig connectionConfig = 
HTTPClient.configureConnectionConfig(properties);
+    assertThat(connectionConfig).isNotNull();
+    
assertThat(connectionConfig.getConnectTimeout().getDuration()).isEqualTo(connectionTimeoutMs);
+    
assertThat(connectionConfig.getSocketTimeout().getDuration()).isEqualTo(socketTimeoutMs);
+  }
+
+  @Test
+  public void testHttpClientWithSocketTimeout() throws IOException {

Review Comment:
   I tried multiple solutions but couldn't specify a custom connection timeout 
on the mockServer. It seems like a network-level configuration and is 
non-trivial to unit test with the existing MockServer that we use in testing.



-- 
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...@iceberg.apache.org

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


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

Reply via email to