HDFS-3344. Unreliable corrupt blocks counting in TestProcessCorruptBlocks. Contributed by Kihwal Lee.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1456172 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kihwal Lee 2013-03-13 21:58:19 +00:00
parent 3bf09c5150
commit 7987bcf3f4
2 changed files with 12 additions and 4 deletions

View File

@ -2422,6 +2422,9 @@ Release 0.23.7 - UNRELEASED
HDFS-4577. Webhdfs operations should declare if authentication is required
(daryn via kihwal)
HDFS-3344. Unreliable corrupt blocks counting in TestProcessCorruptBlocks
(kihwal)
Release 0.23.6 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -158,7 +158,7 @@ public void testByAddingAnExtraDataNode() throws Exception {
* (corrupt replica should be removed since number of good
* replicas (1) is equal to replication factor (1))
*/
@Test
@Test(timeout=20000)
public void testWithReplicationFactorAsOne() throws Exception {
Configuration conf = new HdfsConfiguration();
conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 1000L);
@ -183,9 +183,14 @@ public void testWithReplicationFactorAsOne() throws Exception {
namesystem.setReplication(fileName.toString(), (short) 1);
// wait for 3 seconds so that all block reports are processed.
try {
Thread.sleep(3000);
} catch (InterruptedException ignored) {
for (int i = 0; i < 10; i++) {
try {
Thread.sleep(1000);
} catch (InterruptedException ignored) {
}
if (countReplicas(namesystem, block).corruptReplicas() == 0) {
break;
}
}
assertEquals(1, countReplicas(namesystem, block).liveReplicas());