hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From inigo...@apache.org
Subject [4/5] hadoop git commit: HDFS-13559. TestBlockScanner does not close TestContext properly. Contributed by Anbang Hu.
Date Thu, 17 May 2018 02:25:11 GMT
HDFS-13559. TestBlockScanner does not close TestContext properly. Contributed by Anbang Hu.

(cherry picked from commit 454de3b543c8b00a9ab566c7d1c64d7e4cffee0f)


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

Branch: refs/heads/branch-2
Commit: d2a3bd143050327135d485d1fb7c9ef51d7b09a6
Parents: 9c96822
Author: Inigo Goiri <inigoiri@apache.org>
Authored: Wed May 16 19:23:02 2018 -0700
Committer: Inigo Goiri <inigoiri@apache.org>
Committed: Wed May 16 19:24:36 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d2a3bd14/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockScanner.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockScanner.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockScanner.java
index 4c57479..52923aa 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockScanner.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockScanner.java
@@ -124,6 +124,7 @@ public class TestBlockScanner {
       if (cluster != null) {
         for (int i = 0; i < numNameServices; i++) {
           dfs[i].delete(new Path("/test"), true);
+          dfs[i].close();
         }
         cluster.shutdown();
       }
@@ -816,6 +817,7 @@ public class TestBlockScanner {
           "in recentSuspectBlocks.", info.goodBlocks.contains(first));
       info.blocksScanned = 0;
     }
+    ctx.close();
   }
 
   /**
@@ -872,6 +874,7 @@ public class TestBlockScanner {
       info.blocksScanned = 0;
     }
     info.sem.release(1);
+    ctx.close();
   }
 
   /**
@@ -932,12 +935,12 @@ public class TestBlockScanner {
     os.write(bytes);
     os.hflush();
     os.close();
-    fs.close();
 
     // verify that volume scanner does not find bad blocks after append.
     waitForRescan(info, numExpectedBlocks);
 
     GenericTestUtils.setLogLevel(DataNode.LOG, Level.INFO);
+    ctx.close();
   }
 
   private void waitForRescan(final TestScanResultHandler.Info info,


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message