HDFS-11316. TestDataNodeVolumeFailure#testUnderReplicationAfterVolFailure fails in trunk. Contributed by Yiqun Lin.
This commit is contained in:
parent
383aa9c9f5
commit
724bb86351
|
@ -416,12 +416,22 @@ public class TestDataNodeVolumeFailure {
|
|||
DFSTestUtil.createFile(fs, file2, 1024, (short)3, 1L);
|
||||
DFSTestUtil.waitReplication(fs, file2, (short)3);
|
||||
|
||||
GenericTestUtils.waitFor(new Supplier<Boolean>() {
|
||||
@Override
|
||||
public Boolean get() {
|
||||
// underReplicatedBlocks are due to failed volumes
|
||||
int underReplicatedBlocks =
|
||||
BlockManagerTestUtil.checkHeartbeatAndGetUnderReplicatedBlocksCount(
|
||||
int underReplicatedBlocks = BlockManagerTestUtil
|
||||
.checkHeartbeatAndGetUnderReplicatedBlocksCount(
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue