HADOOP-15532. TestBasicDiskValidator fails with NoSuchFileException. Contributed by Giovanni Matteo Fumarola.

(cherry picked from commit aeaf9fec62)
This commit is contained in:
Inigo Goiri 2018-06-12 14:16:14 -07:00
parent fa9d4a7493
commit 189b6bac8c
1 changed files with 4 additions and 2 deletions

View File

@ -137,7 +137,8 @@ public class TestDiskChecker {
* @throws java.io.IOException if any
*/
protected File createTempFile() throws java.io.IOException {
File testDir = new File(System.getProperty("test.build.data"));
File testDir =
new File(System.getProperty("test.build.data", "target/test-dir"));
return Files.createTempFile(testDir.toPath(), "test", "tmp").toFile();
}
@ -147,7 +148,8 @@ public class TestDiskChecker {
* @throws java.io.IOException if any
*/
protected File createTempDir() throws java.io.IOException {
File testDir = new File(System.getProperty("test.build.data"));
File testDir =
new File(System.getProperty("test.build.data", "target/test-dir"));
return Files.createTempDirectory(testDir.toPath(), "test").toFile();
}