hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r1586040 - in /hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs: ./ CHANGES.txt src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java
Date Wed, 09 Apr 2014 17:02:13 GMT
Author: szetszwo
Date: Wed Apr  9 17:02:12 2014
New Revision: 1586040

URL: http://svn.apache.org/r1586040
Log:
svn merge -c 1586039 from trunk for HDFS-6204. Fix TestRBWBlockInvalidation: change the last
sleep to a loop.

Modified:
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/   (props changed)
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java

Propchange: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/
------------------------------------------------------------------------------
  Merged /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs:r1586039

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1586040&r1=1586039&r2=1586040&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Wed Apr  9
17:02:12 2014
@@ -102,6 +102,9 @@ Release 2.4.1 - UNRELEASED
     HDFS-6206. Fix NullPointerException in DFSUtil.substituteForWildcardAddress.
     (szetszwo) 
 
+    HDFS-6204. Fix TestRBWBlockInvalidation: change the last sleep to a loop.
+    (szetszwo) 
+
 Release 2.4.0 - 2014-04-07 
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java?rev=1586040&r1=1586039&r2=1586040&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestRBWBlockInvalidation.java
Wed Apr  9 17:02:12 2014
@@ -126,16 +126,15 @@ public class TestRBWBlockInvalidation {
         }
         Thread.sleep(100);
       }
-      assertEquals("There should be two live replicas", 2,
-          liveReplicas);
+      assertEquals("There should be two live replicas", 2, liveReplicas);
 
-      // sleep for 2 seconds, so that by this time datanode reports the corrupt
-      // block after a live replica of block got replicated.
-      Thread.sleep(2000);
-
-      // Check that there is no corrupt block in the corruptReplicasMap.
-      assertEquals("There should not be any replica in the corruptReplicasMap",
-          0, countReplicas(namesystem, blk).corruptReplicas());
+      while (true) {
+        Thread.sleep(100);
+        if (countReplicas(namesystem, blk).corruptReplicas() == 0) {
+          LOG.info("Corrupt Replicas becomes 0");
+          break;
+        }
+      }
     } finally {
       if (out != null) {
         out.close();



Mime
View raw message