瀏覽代碼

HDFS-4358. TestCheckpoint failure with JDK7. Contributed by Arpit Agarwal.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1428711 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 12 年之前
父節點
當前提交
5f8de0ad48
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 2 0
      CHANGES.txt
  2. 4 1
      src/test/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java

+ 2 - 0
CHANGES.txt

@@ -388,6 +388,8 @@ Release 1.2.0 - unreleased
     HDFS-4355. TestNameNodeMetrics.testCorruptBlock fails with open JDK7.
     (Brandon Li via suresh)
 
+    HDFS-4358. TestCheckpoint failure with JDK7. (Arpit Agarwal via suresh)
+
 Release 1.1.2 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 4 - 1
src/test/org/apache/hadoop/hdfs/server/namenode/TestCheckpoint.java

@@ -730,6 +730,8 @@ public class TestCheckpoint extends TestCase {
   public void testMultipleSecondaryNameNodes() throws IOException {
     MiniDFSCluster cluster = null;
     FileSystem fs = null;
+    SecondaryNameNode snn1 = null;
+
     try {
       Configuration conf = new Configuration();
       cluster = new MiniDFSCluster(conf, 0, true, null);
@@ -742,7 +744,7 @@ public class TestCheckpoint extends TestCase {
       assertTrue(fs.mkdirs(testPath1));
       
       // Start up a 2NN and do a checkpoint.
-      SecondaryNameNode snn1 = startSecondaryNameNode(conf);
+      snn1 = startSecondaryNameNode(conf);
       snn1.doCheckpoint();
       
       assertTrue(testPath1 + " should still exist after good checkpoint",
@@ -788,6 +790,7 @@ public class TestCheckpoint extends TestCase {
       assertTrue(testPath2 + " should exist after bad checkpoint, after restart",
           fs.exists(testPath2));
     } finally {
+      if(snn1 != null) snn1.shutdown();
       if(fs != null) fs.close();
       if(cluster!= null) cluster.shutdown();
     }