From 43d994e4a6dfd1c24eafb909d6f8a0663b20769a Mon Sep 17 00:00:00 2001 From: Inigo Goiri Date: Fri, 15 Jun 2018 10:33:28 -0700 Subject: [PATCH] HDFS-13673. TestNameNodeMetrics fails on Windows. Contributed by Zuoming Zhang. --- .../hdfs/server/namenode/metrics/TestNameNodeMetrics.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 e34deead95..05cf2ea622 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 @@ -71,6 +71,7 @@ import org.apache.hadoop.hdfs.server.blockmanagement.BlockManager; import org.apache.hadoop.hdfs.server.blockmanagement.BlockManagerTestUtil; import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeDescriptor; +import org.apache.hadoop.hdfs.server.common.Storage; import org.apache.hadoop.hdfs.server.datanode.DataNode; import org.apache.hadoop.hdfs.server.datanode.DataNodeTestUtils; import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsDatasetSpi; @@ -271,7 +272,8 @@ public void testVolumeFailures() throws Exception { File dataDir = new File(fsVolume.getBaseURI()); long capacity = fsVolume.getCapacity(); volumeReferences.close(); - DataNodeTestUtils.injectDataDirFailure(dataDir); + File storageDir = new File(dataDir, Storage.STORAGE_DIR_CURRENT); + DataNodeTestUtils.injectDataDirFailure(storageDir); DataNodeTestUtils.waitForDiskError(dn, fsVolume); DataNodeTestUtils.triggerHeartbeat(dn); BlockManagerTestUtil.checkHeartbeat(bm);