Details
Description
TestLazyPersistFiles#testFileShouldNotDiscardedIfNNRestarted test should be improved.
The test sleeps for 6000 at once, it could at least sleep in a loop checking for the corrupt block to be reported.
cluster.shutdownDataNodes(); cluster.restartNameNodes(); // wait for the redundancy monitor to mark the file as corrupt. Thread.sleep(2 * DFS_NAMENODE_REDUNDANCY_INTERVAL_SECONDS_DEFAULT * 1000); Long corruptBlkCount = (long) Iterators.size(cluster.getNameNode() .getNamesystem().getBlockManager().getCorruptReplicaBlockIterator());
Thanks knanasi for the suggestion.