HDFS-11316. TestDataNodeVolumeFailure#testUnderReplicationAfterVolFailure fails in trunk. Contributed by Yiqun Lin.

(cherry picked from commit 724bb86351)
This commit is contained in:
Yiqun Lin 2017-01-19 12:05:13 +08:00 committed by Eric Payne
parent 952113ebfd
commit daa532b902
1 changed files with 16 additions and 6 deletions

View File

@ -413,12 +413,22 @@ public class TestDataNodeVolumeFailure {
DFSTestUtil.createFile(fs, file2, 1024, (short)3, 1L); DFSTestUtil.createFile(fs, file2, 1024, (short)3, 1L);
DFSTestUtil.waitReplication(fs, file2, (short)3); DFSTestUtil.waitReplication(fs, file2, (short)3);
GenericTestUtils.waitFor(new Supplier<Boolean>() {
@Override
public Boolean get() {
// underReplicatedBlocks are due to failed volumes // underReplicatedBlocks are due to failed volumes
int underReplicatedBlocks = int underReplicatedBlocks = BlockManagerTestUtil
BlockManagerTestUtil.checkHeartbeatAndGetUnderReplicatedBlocksCount( .checkHeartbeatAndGetUnderReplicatedBlocksCount(
cluster.getNamesystem(), bm); cluster.getNamesystem(), bm);
assertTrue("There is no under replicated block after volume failure",
underReplicatedBlocks > 0); if (underReplicatedBlocks > 0) {
return true;
}
LOG.info("There is no under replicated block after volume failure.");
return false;
}
}, 500, 60000);
} }
/** /**