Selaa lähdekoodia

HDFS-13652. Randomize baseDir for MiniDFSCluster in TestBlockScanner. Contributed by Anbang Hu.

(cherry picked from commit a28848104f2a067669f9b1706cd0da05ba71bcb7)
Inigo Goiri 7 vuotta sitten
vanhempi
commit
2e5f849ea5

+ 2 - 1
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockScanner.java

@@ -93,7 +93,8 @@ public class TestBlockScanner {
 
     TestContext(Configuration conf, int numNameServices) throws Exception {
       this.numNameServices = numNameServices;
-      MiniDFSCluster.Builder bld = new MiniDFSCluster.Builder(conf).
+      File basedir = new File(GenericTestUtils.getRandomizedTempPath());
+      MiniDFSCluster.Builder bld = new MiniDFSCluster.Builder(conf, basedir).
           numDataNodes(1).
           storagesPerDatanode(1);
       if (numNameServices > 1) {