mehakmeet commented on code in PR #4331:
URL: https://github.com/apache/hadoop/pull/4331#discussion_r899866576
##########
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/ITestAzureBlobFileSystemRename.java:
##########
@@ -181,17 +181,18 @@ public void testRenameWithNoDestinationParentDir() throws
Exception {
byte[] data = dataset(1024, 'a', 'z');
writeDataset(fs, sourcePath, data, data.length, 1024, true);
- // Check if we have retried the rename operation.
- boolean hasRenameRetriedOnce = fs.getAbfsClient().isHasRetriedRenameOnce();
- assertFalse("Rename shouldn't be retried before attempting to rename",
+ // Check if we have seen an incomplete state.
+ boolean hasRenameRetriedOnce =
fs.getAbfsClient().isMetadataIncompleteState();
+ assertFalse("No incomplete state should be seen before attempting to "
+ + "rename",
hasRenameRetriedOnce);
// Verify that Renaming on a destination with no parent dir wasn't
// successful.
assertFalse(fs.rename(sourcePath, destPath));
- // Verify that Rename operation was retried once after not succeeding.
- hasRenameRetriedOnce = fs.getAbfsClient().isHasRetriedRenameOnce();
+ // Verify that metadata was in an incomplete state after the rename
failure.
+ hasRenameRetriedOnce = fs.getAbfsClient().isMetadataIncompleteState();
Review Comment:
The IOStats won't show that rename failure happened due to parent not found
failure, since in this test we are not actually retrying successfully, as that
is hard to simulate in an integration test, so we would get the exception
thrown back after retrying once. Do you think I should change this test to
verify something differently?
In cases of actual failures we don't send back the abfsClientResult, so it
is kind of hard to test this in ITs 🤔
--
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]