From 63480976a008bab0b84f4da08b1099867e5a9a6b Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Tue, 15 May 2018 15:34:54 -0700 Subject: [PATCH] HDFS-13567. TestNameNodeMetrics#testGenerateEDEKTime,TestNameNodeMetrics#testResourceCheck should use a different cluster basedir. Contributed by Anbang Hu. --- .../hdfs/server/namenode/metrics/TestNameNodeMetrics.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java index db9adbef39b..92bc51c0391 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java @@ -992,8 +992,10 @@ public class TestNameNodeMetrics { .DFS_NAMENODE_DELEGATION_TOKEN_ALWAYS_USE_KEY, true); conf.setInt(DFSConfigKeys.DFS_NAMENODE_LIST_ENCRYPTION_ZONES_NUM_RESPONSES, 2); + File basedir = new File(MiniDFSCluster.getBaseDirectory(), + GenericTestUtils.getMethodName()); - try (MiniDFSCluster clusterEDEK = new MiniDFSCluster.Builder(conf) + try (MiniDFSCluster clusterEDEK = new MiniDFSCluster.Builder(conf, basedir) .numDataNodes(1).build()) { DistributedFileSystem fsEDEK = @@ -1029,7 +1031,9 @@ public class TestNameNodeMetrics { @Test public void testResourceCheck() throws Exception { HdfsConfiguration conf = new HdfsConfiguration(); - MiniDFSCluster tmpCluster = new MiniDFSCluster.Builder(conf) + File basedir = new File(MiniDFSCluster.getBaseDirectory(), + GenericTestUtils.getMethodName()); + MiniDFSCluster tmpCluster = new MiniDFSCluster.Builder(conf, basedir) .numDataNodes(0) .nnTopology(MiniDFSNNTopology.simpleHATopology()) .build();