HDFS-15182. TestBlockManager#testOneOfTwoRacksDecommissioned() fail in trunk. Contributed by Lisheng Sun.

This commit is contained in:
Ayush Saxena 2020-02-22 14:27:26 +05:30
parent ecbcb058b8
commit ba9025c7cd

View File

@ -22,6 +22,7 @@
import com.google.common.collect.LinkedListMultimap;
import com.google.common.collect.Lists;
import org.apache.hadoop.hdfs.protocol.SystemErasureCodingPolicies;
import org.apache.hadoop.hdfs.server.namenode.NameNode;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.CreateFlag;
@ -342,6 +343,8 @@ private void doTestAllNodesHoldingReplicasDecommissioned(int testIndex) throws E
@Test
public void testOneOfTwoRacksDecommissioned() throws Exception {
addNodes(nodes);
NameNode.initMetrics(new Configuration(),
HdfsServerConstants.NamenodeRole.NAMENODE);
for (int i = 0; i < NUM_TEST_ITERS; i++) {
doTestOneOfTwoRacksDecommissioned(i);
}