bhattmanish98 commented on code in PR #7817:
URL: https://github.com/apache/hadoop/pull/7817#discussion_r2280769103
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestAbfsClient.java:
##########
@@ -869,4 +874,217 @@ private void testIsNonEmptyDirectoryInternal(String
firstCT,
.listPath(eq("/testPath"), eq(false), eq(1),
any(), any(TracingContext.class), any());
}
+
+ /**
+ * Test to verify that the KeepAliveCache is initialized with the correct
number of connections.
+ * This test is applicable only for ApacheHttpClient.
+ */
+ @Test
+ public void testKeepAliveCacheInitializationWithApacheHttpClient() throws
Exception {
+ Assume.assumeTrue(APACHE_HTTP_CLIENT == httpOperationType);
+ final AzureBlobFileSystem fs = this.getFileSystem();
+ AbfsClientHandler abfsClientHandler = fs.getAbfsStore().getClientHandler();
+
+ AbfsClient dfsClient = abfsClientHandler.getDfsClient();
+ AbfsClient blobClient = abfsClientHandler.getBlobClient();
+
+ checkKacOnBothClientsAfterFSInit(dfsClient);
+ checkKacOnBothClientsAfterFSInit(blobClient);
+ }
+
+ /**
+ * Test to verify the behavior of stale connections in the KeepAliveCache.
+ * This test is applicable only for ApacheHttpClient.
+ */
+ @Test
+ public void testStaleConnectionBehavior() throws Exception {
+ Assume.assumeTrue(APACHE_HTTP_CLIENT == httpOperationType);
+ Configuration conf = this.getFileSystem().getConf();
+
+ // This is to avoid actual metric calls during the test
+ conf.unset(FS_AZURE_METRIC_ACCOUNT_NAME);
+
+ // Initialize the file system
+ AzureBlobFileSystemStore store = this.getFileSystem(conf).getAbfsStore();
+ AbfsClientHandler abfsClientHandler = store.getClientHandler();
+
+ AbfsClient dfsClient = abfsClientHandler.getDfsClient();
+ AbfsClient blobClient = abfsClientHandler.getBlobClient();
+
+ checkKacOnBothClientsAfterFSInit(dfsClient);
+ checkKacOnBothClientsAfterFSInit(blobClient);
+
+ // Wait for 5 minutes to make the cached connections stale
Review Comment:
During POC we found out this timeout time.
--
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]