[ 
https://issues.apache.org/jira/browse/HADOOP-19271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17881583#comment-17881583
 ] 

ASF GitHub Bot commented on HADOOP-19271:
-----------------------------------------

steveloughran commented on code in PR #7040:
URL: https://github.com/apache/hadoop/pull/7040#discussion_r1758910248


##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestApacheClientConnectionPool.java:
##########
@@ -60,4 +74,36 @@ public void testKacIsClosed() throws Throwable {
       verifyCause(ClosedIOException.class, ex);
     }
   }
+
+  @Test
+  public void testConnectionLogging() throws Exception {
+    HttpHost host = new HttpHost(getFileSystem().getUri().getHost(),
+        getFileSystem().getUri().getPort(),
+        HTTPS_SCHEME);
+    HttpRoute httpRoute = new HttpRoute(host);
+
+    AbfsManagedApacheHttpConnection conn
+        = (AbfsManagedApacheHttpConnection) new 
AbfsHttpClientConnectionFactory().create(
+        httpRoute, null);
+    String log = conn.toString();
+    Assertions.assertThat(log.split(COLON).length)
+        .describedAs("Log to have three field: https://host:port:hashCode";)

Review Comment:
   nit: "fields"



##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestApacheClientConnectionPool.java:
##########
@@ -60,4 +74,36 @@ public void testKacIsClosed() throws Throwable {
       verifyCause(ClosedIOException.class, ex);
     }
   }
+
+  @Test
+  public void testConnectionLogging() throws Exception {

Review Comment:
   I'd like this split into two test cases, for better isolation. You could 
factor out the common stuff with the connection creation being the only 
difference
   * httpRouteConnection
   * validation of the connection





> [ABFS]: NPE in AbfsManagedApacheHttpConnection.toString() when not connected
> ----------------------------------------------------------------------------
>
>                 Key: HADOOP-19271
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19271
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs/azure
>    Affects Versions: 3.4.1
>            Reporter: Steve Loughran
>            Assignee: Pranav Saxena
>            Priority: Blocker
>              Labels: pull-request-available
>
> if {{AbfsManagedApacheHttpConnection.toString()}} is invoked and 
> httpClientConnection is null, you get a stack trace.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to