Browse Source

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

(cherry picked from commit aeaf9fec62f10699d1c809d66444520fe4533c2c)
Inigo Goiri 7 năm trước cách đây
mục cha
commit
189b6bac8c

+ 4 - 2
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestDiskChecker.java

@@ -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();
   }