HDFS-10748. TestFileTruncate#testTruncateWithDataNodesRestart runs sometimes timeout. Contributed by Yiqun Lin.

This commit is contained in:
Xiaoyu Yao 2016-08-25 09:00:44 -07:00
parent 3d86110a5c
commit 4da5000dd3

View File

@ -700,6 +700,9 @@ public void testTruncateWithDataNodesRestart() throws Exception {
assertEquals(newBlock.getBlock().getGenerationStamp(),
oldBlock.getBlock().getGenerationStamp() + 1);
Thread.sleep(2000);
// trigger the second time BR to delete the corrupted replica if there's one
cluster.triggerBlockReports();
// Wait replicas come to 3
DFSTestUtil.waitReplication(fs, p, REPLICATION);
// Old replica is disregarded and replaced with the truncated one