anmolanmol1234 commented on code in PR #7272:
URL: https://github.com/apache/hadoop/pull/7272#discussion_r1910150404
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/services/ITestAbfsOutputStream.java:
##########
@@ -174,28 +187,39 @@ public void testAbfsOutputStreamClosingFsBeforeStream()
fs.close();
// verify that output stream close after fs.close() would raise a
// pathIOE containing the path being written to.
- LambdaTestUtils
- .intercept(PathIOException.class, getMethodName(), out::close);
+ intercept(PathIOException.class, getMethodName(), out::close);
}
}
@Test
public void testExpect100ContinueFailureInAppend() throws Exception {
+ if (!getIsNamespaceEnabled(getFileSystem())) {
+ Assume.assumeFalse("Not valid for APPEND BLOB", isAppendBlobEnabled());
+ }
Configuration configuration = new Configuration(getRawConfiguration());
configuration.set(FS_AZURE_ACCOUNT_IS_EXPECT_HEADER_ENABLED, "true");
AzureBlobFileSystem fs = getFileSystem(configuration);
Path path = new Path("/testFile");
AbfsOutputStream os = Mockito.spy(
(AbfsOutputStream) fs.create(path).getWrappedStream());
- AbfsClient spiedClient = Mockito.spy(os.getClient());
+ AzureIngressHandler ingressHandler = Mockito.spy(
+ os.getIngressHandler());
+ Mockito.doReturn(ingressHandler).when(os).getIngressHandler();
+
+ AbfsClient spiedClient = Mockito.spy(ingressHandler.getClient());
+ Mockito.doReturn(spiedClient).when(ingressHandler).getClient();
AbfsHttpOperation[] httpOpForAppendTest = new AbfsHttpOperation[2];
mockSetupForAppend(httpOpForAppendTest, spiedClient);
Mockito.doReturn(spiedClient).when(os).getClient();
fs.delete(path, true);
os.write(1);
- LambdaTestUtils.intercept(FileNotFoundException.class, () -> {
- os.close();
- });
+ if (spiedClient instanceof AbfsDfsClient) {
+ intercept(FileNotFoundException.class, os::close);
+ } else {
Review Comment:
DFS throws FileNotFoundException while Blob throws IOException
--
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]