-
Notifications
You must be signed in to change notification settings - Fork 621
HDDS-6646. Intermittent failure in TestOzoneFileSystem#testRenameToTrashEnabled #5217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
2fcee89
d835998
b1b22f0
29e6c25
429eba3
768c833
fbc62a2
bfea174
02a62c5
183536e
900a80d
841d72d
fc4c53c
ec783f0
858e1ba
4ec8886
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -802,6 +802,7 @@ protected void deleteRootDir() throws IOException, InterruptedException { | |
| return; | ||
| } | ||
| deleteRootRecursively(fileStatuses); | ||
| Thread.sleep(500); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How sleep for 500ms solves the problem?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 I don't get either why
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since now GenericTestUtils is being used, I have not removed TimeoutException. This change is not directly related, however many other tests are getting impacted because of deleteRootDIr cleanup, so this is important as part of this test as well. |
||
| fileStatuses = fs.listStatus(ROOT); | ||
| if (fileStatuses != null) { | ||
| Assert.assertEquals( | ||
|
|
@@ -1618,15 +1619,13 @@ public void testGetTrashRoots() throws IOException { | |
| * since fs.rename(src,dst,options) is enabled. | ||
| */ | ||
| @Test | ||
| @Flaky("HDDS-6646") | ||
| public void testRenameToTrashEnabled() throws Exception { | ||
|
sadanand48 marked this conversation as resolved.
Outdated
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was the test removal intended? because earlier commit had fixed the test and description also says so.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes @sadanand48 , as HDDS-6645 will be taking care of testTrash test case fix, so the only assertion which was different from
smengcl marked this conversation as resolved.
|
||
| // Create a file | ||
| String testKeyName = "testKey1"; | ||
| Path path = new Path(OZONE_URI_DELIMITER, testKeyName); | ||
| try (FSDataOutputStream stream = fs.create(path)) { | ||
| stream.write(1); | ||
| } | ||
|
|
||
| // Call moveToTrash. We can't call protected fs.rename() directly | ||
| trash.moveToTrash(path); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use GenericTestUtils#waitFor instead of
Thread.sleep()?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemantk-12 thanks for the review, I tried using GenericTestUtils, however this in actual run throwing always TimeOutException and not working in this case.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprise that
Thread.sleep()works fine but GenericTestUtils#waitFor doesn't. Just curious what was lambda used?I feel this should work if it is just about cleaning dir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hemantk-12 for review. I have handled as per your suggestion.