diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java index b6bb5f2d18..01288321c8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java @@ -854,6 +854,7 @@ public void testChooseSrcDNWithDupECInDecommissioningNode() throws Exception { @Test public void testSkipReconstructionWithManyBusyNodes() { + NameNode.initMetrics(new Configuration(), HdfsServerConstants.NamenodeRole.NAMENODE); long blockId = -9223372036854775776L; // real ec block id // RS-3-2 EC policy ErasureCodingPolicy ecPolicy = @@ -899,6 +900,7 @@ public void testSkipReconstructionWithManyBusyNodes() { @Test public void testSkipReconstructionWithManyBusyNodes2() { + NameNode.initMetrics(new Configuration(), HdfsServerConstants.NamenodeRole.NAMENODE); long blockId = -9223372036854775776L; // real ec block id // RS-3-2 EC policy ErasureCodingPolicy ecPolicy =