Sebb created IO-858:
-----------------------
Summary: FileUtilsWaitForTest does not test anything useful
Key: IO-858
URL: https://issues.apache.org/jira/browse/IO-858
Project: Commons IO
Issue Type: Bug
Reporter: Sebb
AFAICT, FileUtilsWaitForTest [1] does not do anything useful currently.
Of the 3 tests, 2 don't check the return status, nor do they appear to be
trying to test for Exceptions.
The 3rd test - testWaitForInterrupted - appears to be testing the response of
FileUtils.waitFor() to an interruption. However it does not do so, as the
waitFor() target is FileUtils.current() which is certain to exist. As it
stands, AFAICT the test checks if the main thread can interrupt the test thread
before it sets the wasInterrupted flag. This currently relies on relative
thread timings, so it is not surprising that the test is flaky.
There should ideally be a test for IO-488, as well as tests for targets that
are present or missing or which appear during a wait.
[1]
https://github.com/apache/commons-io/blob/master/src/test/java/org/apache/commons/io/FileUtilsWaitForTest.java
--
This message was sent by Atlassian Jira
(v8.20.10#820010)