This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-io.git
commit 3d1980bc6dce0fd80ccceb9cef807ac36d799de4 Author: Gary Gregory <gardgreg...@gmail.com> AuthorDate: Sat Sep 11 07:23:41 2021 -0700 Test that the file exists one last time on exit. --- src/main/java/org/apache/commons/io/file/PathUtils.java | 2 +- src/test/java/org/apache/commons/io/FileUtilsWaitForTestCase.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/io/file/PathUtils.java b/src/main/java/org/apache/commons/io/file/PathUtils.java index 44f04e7..2136ac7 100644 --- a/src/main/java/org/apache/commons/io/file/PathUtils.java +++ b/src/main/java/org/apache/commons/io/file/PathUtils.java @@ -1107,7 +1107,7 @@ public final class PathUtils { Thread.currentThread().interrupt(); } } - return true; + return Files.exists(file, options); } /** diff --git a/src/test/java/org/apache/commons/io/FileUtilsWaitForTestCase.java b/src/test/java/org/apache/commons/io/FileUtilsWaitForTestCase.java index 544d423..a751064 100644 --- a/src/test/java/org/apache/commons/io/FileUtilsWaitForTestCase.java +++ b/src/test/java/org/apache/commons/io/FileUtilsWaitForTestCase.java @@ -48,7 +48,7 @@ public class FileUtilsWaitForTestCase { final CountDownLatch started = new CountDownLatch(1); final Thread thread1 = new Thread(() -> { started.countDown(); - FileUtils.waitFor(FileUtils.current(), 2); + assertTrue(FileUtils.waitFor(FileUtils.current(), 4)); wasInterrupted.set(Thread.currentThread().isInterrupted()); }); thread1.start();