فهرست منبع

Merge r1574999 from branch-2.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.4@1575003 13f79535-47bb-0310-9956-ffa450edef68
Haohui Mai 11 سال پیش
والد
کامیت
a6d24fb94d

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -298,6 +298,8 @@ Release 2.4.0 - UNRELEASED
     HDFS-6058. Fix TestHDFSCLI failures after HADOOP-8691 change.
     (Akira Ajisaka via wheat9)
 
+    HDFS-6062. TestRetryCacheWithHA#testConcat is flaky. (Jing Zhao via wheat9)
+
     HDFS-6059. TestBlockReaderLocal fails if native library is not available.
     (Akira AJISAKA via Colin Patrick McCabe)
 

+ 7 - 3
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestRetryCacheWithHA.java

@@ -562,10 +562,12 @@ public class TestRetryCacheWithHA {
 
     @Override
     void prepare() throws Exception {
-      DFSTestUtil.createFile(dfs, new Path(target), BlockSize, DataNodes, 0);
+      final Path targetPath = new Path(target);
+      DFSTestUtil.createFile(dfs, targetPath, BlockSize, DataNodes, 0);
       for (int i = 0; i < srcPaths.length; i++) {
         DFSTestUtil.createFile(dfs, srcPaths[i], BlockSize, DataNodes, 0);
       }
+      assertEquals(BlockSize, dfs.getFileStatus(targetPath).getLen());
     }
 
     @Override
@@ -576,10 +578,12 @@ public class TestRetryCacheWithHA {
     @Override
     boolean checkNamenodeBeforeReturn() throws Exception {
       Path targetPath = new Path(target);
-      boolean done = dfs.exists(targetPath);
+      boolean done = dfs.getFileStatus(targetPath).getLen() == BlockSize
+          * (srcs.length + 1);
       for (int i = 0; i < CHECKTIMES && !done; i++) {
         Thread.sleep(1000);
-        done = dfs.exists(targetPath);
+        done = dfs.getFileStatus(targetPath).getLen() == BlockSize
+            * (srcs.length + 1);
       }
       return done;
     }