Skip to content

Commit

Permalink
Mitigate (unrelated) TestOzoneFileSystem flakiness.
Browse files Browse the repository at this point in the history
  • Loading branch information
smengcl committed Sep 1, 2023
1 parent 863a7e9 commit 72c297d
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public TestOzoneFileSystem(boolean setDefaultFs, boolean enableOMRatis) {
* Set a timeout for each test.
*/
@Rule
public Timeout timeout = Timeout.seconds(300);
public Timeout timeout = Timeout.seconds(600);

private static final Logger LOG =
LoggerFactory.getLogger(TestOzoneFileSystem.class);
Expand Down Expand Up @@ -802,8 +802,18 @@ protected void deleteRootDir() throws IOException, InterruptedException {
return;
}
deleteRootRecursively(fileStatuses);

// Waiting for double buffer flush before calling listStatus() again
// seem to have mitigated the flakiness in cleanup(), but at the cost of
// almost doubling the test run time. M1 154s->283s (all 4 sets of params)
cluster.getOzoneManager().awaitDoubleBufferFlush();
// TODO: Investigate whether listStatus() is correctly iterating cache.

fileStatuses = fs.listStatus(ROOT);
if (fileStatuses != null) {
for (FileStatus fileStatus : fileStatuses) {
LOG.error("Unexpected file, should be been deleted: {}", fileStatus);
}
Assert.assertEquals(
"Delete root failed!", 0, fileStatuses.length);
}
Expand Down

0 comments on commit 72c297d

Please sign in to comment.