HDFS-8729. Fix TestFileTruncate#testTruncateWithDataNodesRestartImmediately which occasionally failed. Contributed by Walter Su.

This commit is contained in:
Jing Zhao 2015-07-09 13:17:52 -07:00
parent ac6048372a
commit f4ca530c1c
2 changed files with 6 additions and 0 deletions

View File

@ -1023,6 +1023,9 @@ Release 2.8.0 - UNRELEASED
HDFS-8642. Make TestFileTruncate more reliable. (Rakesh R via
Arpit Agarwal)
HDFS-8729. Fix TestFileTruncate#testTruncateWithDataNodesRestartImmediately
which occasionally failed. (Walter Su via jing9)
Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES

View File

@ -804,6 +804,9 @@ public class TestFileTruncate {
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 on dn0