Skip to content

Commit b59bc1d

Browse files
committed
[IO-856] Tests ListFiles should not fail on vanishing files
Try to show the stack trace on test failures on GitHub Maven CI builds
1 parent 92c5e8c commit b59bc1d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/test/java/org/apache/commons/io/FileUtilsListFilesTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ public void testListFilesWithDeletionThreaded() throws ExecutionException, Inter
257257
try {
258258
Files.write(file.toPath(), bytes);
259259
} catch (final Exception e) {
260-
fail("Could not create test file: " + file.getAbsolutePath(), e);
260+
fail("Could not create test file: '" + file.getAbsolutePath() + "': " + e, e);
261261
}
262262
if (!file.delete()) {
263-
fail("Could not delete test file: " + file.getAbsolutePath());
263+
fail("Could not delete test file: '" + file.getAbsolutePath() + "'");
264264
}
265265
}
266266
});
@@ -271,7 +271,9 @@ public void testListFilesWithDeletionThreaded() throws ExecutionException, Inter
271271
FileUtils.listFiles(tempDir, new String[] { "\\.deletetester" }, false);
272272
}
273273
} catch (final Exception e) {
274-
fail("Should not happen", e);
274+
fail("IO-856 test failure: " + e, e);
275+
// The exception can be hidden.
276+
e.printStackTrace();
275277
}
276278
});
277279
// wait for the threads to finish

0 commit comments

Comments
 (0)