HDFS-9865. TestBlockReplacement fails intermittently in trunk (Lin Yiqun via iwasakims)
This commit is contained in:
parent
4163e36c2b
commit
d718fc1ee5
@ -412,11 +412,19 @@ public void testDeletedBlockWhenAddBlockIsInEdit() throws Exception {
|
|||||||
(DatanodeInfo)sourceDnDesc, (DatanodeInfo)sourceDnDesc,
|
(DatanodeInfo)sourceDnDesc, (DatanodeInfo)sourceDnDesc,
|
||||||
(DatanodeInfo)destDnDesc));
|
(DatanodeInfo)destDnDesc));
|
||||||
// Waiting for the FsDatasetAsyncDsikService to delete the block
|
// Waiting for the FsDatasetAsyncDsikService to delete the block
|
||||||
Thread.sleep(3000);
|
for (int tries = 0; tries < 20; tries++) {
|
||||||
// Triggering the incremental block report to report the deleted block to
|
Thread.sleep(1000);
|
||||||
// namnemode
|
// Triggering the deletion block report to report the deleted block
|
||||||
cluster.getDataNodes().get(0).triggerBlockReport(
|
// to namnemode
|
||||||
new BlockReportOptions.Factory().setIncremental(true).build());
|
DataNodeTestUtils.triggerDeletionReport(cluster.getDataNodes().get(0));
|
||||||
|
locatedBlocks =
|
||||||
|
client.getNamenode().getBlockLocations("/tmp.txt", 0, 10L)
|
||||||
|
.getLocatedBlocks();
|
||||||
|
// If block was deleted and only on 1 datanode then break out
|
||||||
|
if (locatedBlocks.get(0).getLocations().length == 1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cluster.transitionToStandby(0);
|
cluster.transitionToStandby(0);
|
||||||
cluster.transitionToActive(1);
|
cluster.transitionToActive(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user