diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 599197b8db..d448e54406 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -283,6 +283,9 @@ Trunk (Unreleased) HDFS-4274. BlockPoolSliceScanner does not close verification log during shutdown. (Chris Nauroth via suresh) + HDFS-4275. MiniDFSCluster-based tests fail on Windows due to failure + to delete test namenode directory. (Chris Nauroth via suresh) + Release 2.0.3-alpha - Unreleased INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockRecovery.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockRecovery.java index a400e85059..a5792ad217 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockRecovery.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockRecovery.java @@ -97,6 +97,7 @@ public class TestBlockRecovery { MiniDFSCluster.getBaseDirectory() + "data"; private DataNode dn; private Configuration conf; + private boolean tearDownDone; private final static long RECOVERY_ID = 3000L; private final static String CLUSTER_ID = "testClusterID"; private final static String POOL_ID = "BP-TEST"; @@ -121,6 +122,7 @@ public class TestBlockRecovery { */ @Before public void startUp() throws IOException { + tearDownDone = false; conf = new HdfsConfiguration(); conf.set(DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY, DATA_DIR); conf.set(DFSConfigKeys.DFS_DATANODE_ADDRESS_KEY, "0.0.0.0:0"); @@ -177,7 +179,7 @@ DatanodeProtocolClientSideTranslatorPB connectToNN( */ @After public void tearDown() throws IOException { - if (dn != null) { + if (!tearDownDone && dn != null) { try { dn.shutdown(); } catch(Exception e) { @@ -188,6 +190,7 @@ public void tearDown() throws IOException { Assert.assertTrue( "Cannot delete data-node dirs", FileUtil.fullyDelete(dir)); } + tearDownDone = true; } }