HDFS-4275. MiniDFSCluster-based tests fail on Windows due to failure to delete test namenode directory. Contributed by Chris Nauroth.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1422278 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8aee71d1bc
commit
3363c45d69
@ -283,6 +283,9 @@ Trunk (Unreleased)
|
|||||||
HDFS-4274. BlockPoolSliceScanner does not close verification log during
|
HDFS-4274. BlockPoolSliceScanner does not close verification log during
|
||||||
shutdown. (Chris Nauroth via suresh)
|
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
|
Release 2.0.3-alpha - Unreleased
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -97,6 +97,7 @@ public class TestBlockRecovery {
|
|||||||
MiniDFSCluster.getBaseDirectory() + "data";
|
MiniDFSCluster.getBaseDirectory() + "data";
|
||||||
private DataNode dn;
|
private DataNode dn;
|
||||||
private Configuration conf;
|
private Configuration conf;
|
||||||
|
private boolean tearDownDone;
|
||||||
private final static long RECOVERY_ID = 3000L;
|
private final static long RECOVERY_ID = 3000L;
|
||||||
private final static String CLUSTER_ID = "testClusterID";
|
private final static String CLUSTER_ID = "testClusterID";
|
||||||
private final static String POOL_ID = "BP-TEST";
|
private final static String POOL_ID = "BP-TEST";
|
||||||
@ -121,6 +122,7 @@ public class TestBlockRecovery {
|
|||||||
*/
|
*/
|
||||||
@Before
|
@Before
|
||||||
public void startUp() throws IOException {
|
public void startUp() throws IOException {
|
||||||
|
tearDownDone = false;
|
||||||
conf = new HdfsConfiguration();
|
conf = new HdfsConfiguration();
|
||||||
conf.set(DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY, DATA_DIR);
|
conf.set(DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY, DATA_DIR);
|
||||||
conf.set(DFSConfigKeys.DFS_DATANODE_ADDRESS_KEY, "0.0.0.0:0");
|
conf.set(DFSConfigKeys.DFS_DATANODE_ADDRESS_KEY, "0.0.0.0:0");
|
||||||
@ -177,7 +179,7 @@ public class TestBlockRecovery {
|
|||||||
*/
|
*/
|
||||||
@After
|
@After
|
||||||
public void tearDown() throws IOException {
|
public void tearDown() throws IOException {
|
||||||
if (dn != null) {
|
if (!tearDownDone && dn != null) {
|
||||||
try {
|
try {
|
||||||
dn.shutdown();
|
dn.shutdown();
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
@ -188,6 +190,7 @@ public class TestBlockRecovery {
|
|||||||
Assert.assertTrue(
|
Assert.assertTrue(
|
||||||
"Cannot delete data-node dirs", FileUtil.fullyDelete(dir));
|
"Cannot delete data-node dirs", FileUtil.fullyDelete(dir));
|
||||||
}
|
}
|
||||||
|
tearDownDone = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user