浏览代码

HDFS-4355. TestNameNodeMetrics.testCorruptBlock fails with open JDK7. Contributed by Brandon Li.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1428631 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 12 年之前
父节点
当前提交
72783520ab
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 3 0
      CHANGES.txt
  2. 2 1
      src/test/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java

+ 3 - 0
CHANGES.txt

@@ -385,6 +385,9 @@ Release 1.2.0 - unreleased
     MAPREDUCE-4909. TestKeyValueTextInputFormat fails with Open JDK 7 on
     MAPREDUCE-4909. TestKeyValueTextInputFormat fails with Open JDK 7 on
     Windows. (Arpit Agarwal via suresh)
     Windows. (Arpit Agarwal via suresh)
 
 
+    HDFS-4355. TestNameNodeMetrics.testCorruptBlock fails with open JDK7.
+    (Brandon Li via suresh)
+
 Release 1.1.2 - Unreleased
 Release 1.1.2 - Unreleased
 
 
   INCOMPATIBLE CHANGES
   INCOMPATIBLE CHANGES

+ 2 - 1
src/test/org/apache/hadoop/hdfs/server/namenode/metrics/TestNameNodeMetrics.java

@@ -103,7 +103,7 @@ public class TestNameNodeMetrics extends TestCase {
 
 
   /** Test metrics associated with addition of a file */
   /** Test metrics associated with addition of a file */
   public void testFileAdd() throws Exception {
   public void testFileAdd() throws Exception {
-    // Add files with 100 blocks
+    // Add files with 32 blocks
     final Path file = getTestPath("testFileAdd");
     final Path file = getTestPath("testFileAdd");
     createFile(file, 3200, (short)3);
     createFile(file, 3200, (short)3);
     final long blockCount = 32;
     final long blockCount = 32;
@@ -148,6 +148,7 @@ public class TestNameNodeMetrics extends TestCase {
   
   
   /** Corrupt a block and ensure metrics reflects it */
   /** Corrupt a block and ensure metrics reflects it */
   public void testCorruptBlock() throws Exception {
   public void testCorruptBlock() throws Exception {
+    fs.delete(new Path("/"), true);
     // Create a file with single block with two replicas
     // Create a file with single block with two replicas
     final Path file = getTestPath("testCorruptBlock");
     final Path file = getTestPath("testCorruptBlock");
     createFile(file, 100, (short)2);
     createFile(file, 100, (short)2);