Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.9.0
-
None
-
None
Description
In TestBasicDiskValidator, the following code is confusing
File localDir = File.createTempFile("test", "tmp"); try { if (isDir) { // reuse the file path generated by File#createTempFile to create a dir localDir.delete(); localDir.mkdir(); }
Btw, as suggested in https://wiki.apache.org/hadoop/CodeReviewChecklist, unit test should not write data into /tmp:
* unit tests do not write any temporary files to /tmp (instead, the tests should write to the location specified by the test.build.data system property)
Finally, should use Files in these file creation / deletion, so that any error can be thrown as IOE.
Attachments
Attachments
Issue Links
- duplicates
-
HADOOP-13254 Create framework for configurable disk checkers
-
- Resolved
-
- relates to
-
HADOOP-15532 TestBasicDiskValidator fails with NoSuchFileException
-
- Resolved
-