Browse Source

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 năm trước cách đây
mục cha
commit
72783520ab

+ 3 - 0
CHANGES.txt

@@ -385,6 +385,9 @@ Release 1.2.0 - unreleased
     MAPREDUCE-4909. TestKeyValueTextInputFormat fails with Open JDK 7 on
     Windows. (Arpit Agarwal via suresh)
 
+    HDFS-4355. TestNameNodeMetrics.testCorruptBlock fails with open JDK7.
+    (Brandon Li via suresh)
+
 Release 1.1.2 - Unreleased
 
   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 */
   public void testFileAdd() throws Exception {
-    // Add files with 100 blocks
+    // Add files with 32 blocks
     final Path file = getTestPath("testFileAdd");
     createFile(file, 3200, (short)3);
     final long blockCount = 32;
@@ -148,6 +148,7 @@ public class TestNameNodeMetrics extends TestCase {
   
   /** Corrupt a block and ensure metrics reflects it */
   public void testCorruptBlock() throws Exception {
+    fs.delete(new Path("/"), true);
     // Create a file with single block with two replicas
     final Path file = getTestPath("testCorruptBlock");
     createFile(file, 100, (short)2);