Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The unit tests write many files and directories as direct children of directory /tmp and don't delete them. That clutters up /tmp. That also means that the state of /tmp/... can interfere with the tests.
Also, because of that, many unit tests use file pathnames that are not unique to each test run. That means that simultaneous test runs can interfere. Additionally, given that the files are not deleted, that means that a later test run can be affected by an earlier test run. (Additionally, at least a few test methods write to the same relative file names, meaning those tests can interfere with each other.)
Recommendations:
- At least change the parent directory from /tmp to a subdirectory of /tmp.
- Change to a parent directory whose name is unique to the test run (e.g., as JUnit's TemporaryFolder rule would create).
- Consider: Normally delete the temporary files after use (as TemporaryFolder does), but provide a convenient option to keep the files (possibly automatically defaulting to keeping in debugging mode).
- Probably use JUnit's TemporaryFolder rule (to get unique names, to delete after test). (Investigate how to conditionally disable deleting the files.)