Repository: hadoop
Updated Branches:
  refs/heads/branch-2 b8d8c25a1 -> 4276a858f
  refs/heads/branch-2.9 733632f09 -> 3ec0c11e8


HDFS-13337. Backport HDFS-4275 to branch-2.9. Contributed by Xiao Liang.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4276a858
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4276a858
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4276a858

Branch: refs/heads/branch-2
Commit: 4276a858f85cb4127b8dfc32612604dbc6dfc4ca
Parents: b8d8c25
Author: Inigo Goiri <[email protected]>
Authored: Tue Apr 3 13:55:44 2018 -0700
Committer: Inigo Goiri <[email protected]>
Committed: Tue Apr 3 13:55:44 2018 -0700

----------------------------------------------------------------------
 .../apache/hadoop/hdfs/server/datanode/TestBlockRecovery.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4276a858/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockRecovery.java
----------------------------------------------------------------------
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 15a416d..70472d7 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
@@ -126,6 +126,7 @@ public class TestBlockRecovery {
   private DataNode spyDN;
   private BlockRecoveryWorker recoveryWorker;
   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";
@@ -156,6 +157,7 @@ public class TestBlockRecovery {
    */
   @Before
   public void startUp() throws IOException, URISyntaxException {
+    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");
@@ -252,7 +254,7 @@ public class TestBlockRecovery {
    */
   @After
   public void tearDown() throws IOException {
-    if (dn != null) {
+    if (!tearDownDone && dn != null) {
       try {
         dn.shutdown();
       } catch(Exception e) {
@@ -263,6 +265,7 @@ public class TestBlockRecovery {
           Assert.assertTrue(
               "Cannot delete data-node dirs", FileUtil.fullyDelete(dir));
       }
+      tearDownDone = true;
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to