Browse Source

HDFS-13649. Randomize baseDir for MiniDFSCluster in TestReconstructStripedFile and TestReconstructStripedFileWithRandomECPolicy. Contributed by Anbang Hu.

(cherry picked from commit 16316b60112842cf8a328b79c89297f6a8b30e7b)
Inigo Goiri 7 năm trước cách đây
mục cha
commit
076dc95c76

+ 3 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestReconstructStripedFile.java

@@ -110,7 +110,9 @@ public class TestReconstructStripedFile {
           CodecUtil.IO_ERASURECODE_CODEC_RS_RAWCODERS_KEY,
           NativeRSRawErasureCoderFactory.CODER_NAME);
     }
-    cluster = new MiniDFSCluster.Builder(conf).numDataNodes(dnNum).build();
+    File basedir = new File(GenericTestUtils.getRandomizedTempPath());
+    cluster = new MiniDFSCluster.Builder(conf, basedir).numDataNodes(dnNum)
+        .build();
     cluster.waitActive();
 
     fs = cluster.getFileSystem();