Skip to content

Commit

Permalink
[IO-856] Tests ListFiles should not fail on vanishing files
Browse files Browse the repository at this point in the history
Try to show the stack trace on test failures on GitHub Maven CI builds
  • Loading branch information
garydgregory committed Nov 10, 2024
1 parent 92c5e8c commit b59bc1d
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ public void testListFilesWithDeletionThreaded() throws ExecutionException, Inter
try {
Files.write(file.toPath(), bytes);
} catch (final Exception e) {
fail("Could not create test file: " + file.getAbsolutePath(), e);
fail("Could not create test file: '" + file.getAbsolutePath() + "': " + e, e);
}
if (!file.delete()) {
fail("Could not delete test file: " + file.getAbsolutePath());
fail("Could not delete test file: '" + file.getAbsolutePath() + "'");
}
}
});
Expand All @@ -271,7 +271,9 @@ public void testListFilesWithDeletionThreaded() throws ExecutionException, Inter
FileUtils.listFiles(tempDir, new String[] { "\\.deletetester" }, false);
}
} catch (final Exception e) {
fail("Should not happen", e);
fail("IO-856 test failure: " + e, e);
// The exception can be hidden.
e.printStackTrace();
}
});
// wait for the threads to finish
Expand Down

0 comments on commit b59bc1d

Please sign in to comment.