snvijaya commented on a change in pull request #1498: HADOOP-16578 : Avoid 
FileSystem API calls when FileSystem already exists
URL: https://github.com/apache/hadoop/pull/1498#discussion_r328958236
 
 

 ##########
 File path: 
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestGetNameSpaceEnabled.java
 ##########
 @@ -67,10 +69,10 @@ public void testFailedRequestWhenFSNotExist() throws 
Exception {
             + testUri.substring(testUri.indexOf("@"));
     AzureBlobFileSystem fs = this.getFileSystem(nonExistingFsUrl);
 
-    intercept(AbfsRestOperationException.class,
+    intercept(FileNotFoundException.class,
             "\"The specified filesystem does not exist.\", 404",
             ()-> {
-              fs.getIsNamespaceEnabled();
 
 Review comment:
   getIsNamespaceEnabled() suppresses exceptions when HttpStatusCode returned 
is 400 BadRequest. 
   When the test is run with a Namespace enabled account, getAccessControl (API 
call triggered within getIsNamespaceEnabled()) will return 404 HttpStatusCode 
and exception type as AbfsRestOperationException. This satisfies the 
intercept() within the test method. 
   But when the test is run with an account which is not namespace enabled, 
getAccessControl() returns 400 BadRequest. Hence Test does not receive any 
exceptions and fails. 
   The code update to change the test call to getFileStatus() will return a 
consistent 404 HttpStatusCode - and exception as FileNotFoundException, for 
both account with and without NameSpace enabled.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to