Merge 1552256 from trunk: HDFS-5540. Fix intermittent failure in TestBlocksWithNotEnoughRacks. (Binglin Chang via junping_du)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1552278 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Junping Du 2013-12-19 10:10:24 +00:00
parent 3d22b5fd40
commit 35dda73fba
2 changed files with 11 additions and 2 deletions

View File

@ -184,6 +184,9 @@ Release 2.4.0 - UNRELEASED
HDFS-5663 make the retry time and interval value configurable in openInfo() HDFS-5663 make the retry time and interval value configurable in openInfo()
(Liang Xie via stack) (Liang Xie via stack)
HDFS-5540. Fix intermittent failure in TestBlocksWithNotEnoughRacks.
(Binglin Chang via junping_du)
OPTIMIZATIONS OPTIMIZATIONS
HDFS-5239. Allow FSNamesystem lock fairness to be configurable (daryn) HDFS-5239. Allow FSNamesystem lock fairness to be configurable (daryn)

View File

@ -364,9 +364,15 @@ public class DFSTestUtil {
// Swallow exceptions // Swallow exceptions
} }
System.out.println("Waiting for "+corruptRepls+" corrupt replicas"); System.out.println("Waiting for "+corruptRepls+" corrupt replicas");
repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
count++; count++;
Thread.sleep(1000); // check more often so corrupt block reports are not easily missed
for (int i = 0; i < 10; i++) {
repls = ns.getBlockManager().numCorruptReplicas(b.getLocalBlock());
Thread.sleep(100);
if (repls == corruptRepls) {
break;
}
}
} }
if (count == ATTEMPTS) { if (count == ATTEMPTS) {
throw new TimeoutException("Timed out waiting for corrupt replicas." throw new TimeoutException("Timed out waiting for corrupt replicas."