HDFS-10618. TestPendingReconstruction#testPendingAndInvalidate is flaky due to race condition. Contributed by Eric Badger.
This commit is contained in:
parent
457895d50f
commit
88c749a903
|
@ -457,14 +457,14 @@ public class TestPendingReplication {
|
|||
"STORAGE_ID", "TEST");
|
||||
bm.findAndMarkBlockAsCorrupt(block.getBlock(), block.getLocations()[1],
|
||||
"STORAGE_ID", "TEST");
|
||||
BlockManagerTestUtil.computeAllPendingWork(bm);
|
||||
BlockManagerTestUtil.updateState(bm);
|
||||
assertEquals(bm.getPendingReplicationBlocksCount(), 1L);
|
||||
BlockInfo storedBlock = bm.getStoredBlock(block.getBlock().getLocalBlock());
|
||||
assertEquals(bm.pendingReplications.getNumReplicas(storedBlock), 2);
|
||||
} finally {
|
||||
cluster.getNamesystem().writeUnlock();
|
||||
}
|
||||
BlockManagerTestUtil.computeAllPendingWork(bm);
|
||||
BlockManagerTestUtil.updateState(bm);
|
||||
assertEquals(bm.getPendingReplicationBlocksCount(), 1L);
|
||||
BlockInfo storedBlock = bm.getStoredBlock(block.getBlock().getLocalBlock());
|
||||
assertEquals(bm.pendingReplications.getNumReplicas(storedBlock), 2);
|
||||
|
||||
// 4. delete the file
|
||||
fs.delete(filePath, true);
|
||||
|
|
Loading…
Reference in New Issue