bhattmanish98 commented on code in PR #7967:
URL: https://github.com/apache/hadoop/pull/7967#discussion_r2393520715


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestApacheClientConnectionPool.java:
##########
@@ -118,6 +121,38 @@ public void testConnectedConnectionLogging() throws 
Exception {
         .isEqualTo(4);
   }
 
+  /**
+   * Test to verify that the ApacheHttpClient falls back to JDK client
+   * when connection warmup fails.
+   * This test is applicable only for ApacheHttpClient.
+   */
+  @Test
+  public void testApacheClientFallbackDuringConnectionWarmup()
+      throws Exception {
+    try (KeepAliveCache keepAliveCache = new KeepAliveCache(
+        new AbfsConfiguration(new Configuration(), EMPTY_STRING))) {
+      // Create a connection manager with invalid URL to force fallback to JDK 
client
+      // during connection warmup.
+      // This is to simulate failure during connection warmup in the 
connection manager.
+      // The invalid URL will cause the connection manager to fail to create 
connections
+      // during warmup, forcing it to fall back to JDK client.
+      final AbfsConnectionManager connMgr = new AbfsConnectionManager(
+          RegistryBuilder.<ConnectionSocketFactory>create()
+              .register(HTTPS_SCHEME, new SSLConnectionSocketFactory(
+                  DelegatingSSLSocketFactory.getDefaultFactory(),
+                  getDefaultHostnameVerifier()))
+              .build(),
+          new AbfsHttpClientConnectionFactory(), keepAliveCache,
+          new AbfsConfiguration(new Configuration(), EMPTY_STRING),
+          new URL("https://test.com";), true);
+
+      Assertions.assertThat(AbfsApacheHttpClient.usable())
+          .describedAs("Apache HttpClient should be not usable")

Review Comment:
   Sure, will do that.



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