HDFS-10618. TestPendingReconstruction#testPendingAndInvalidate is flaky due to race condition. Contributed by Eric Badger.
This commit is contained in:
parent
ac627f561f
commit
cceb68ffea
@ -456,14 +456,14 @@ public void testPendingAndInvalidate() throws Exception {
|
|||||||
"STORAGE_ID", "TEST");
|
"STORAGE_ID", "TEST");
|
||||||
bm.findAndMarkBlockAsCorrupt(block.getBlock(), block.getLocations()[1],
|
bm.findAndMarkBlockAsCorrupt(block.getBlock(), block.getLocations()[1],
|
||||||
"STORAGE_ID", "TEST");
|
"STORAGE_ID", "TEST");
|
||||||
} finally {
|
|
||||||
cluster.getNamesystem().writeUnlock();
|
|
||||||
}
|
|
||||||
BlockManagerTestUtil.computeAllPendingWork(bm);
|
BlockManagerTestUtil.computeAllPendingWork(bm);
|
||||||
BlockManagerTestUtil.updateState(bm);
|
BlockManagerTestUtil.updateState(bm);
|
||||||
assertEquals(bm.getPendingReconstructionBlocksCount(), 1L);
|
assertEquals(bm.getPendingReconstructionBlocksCount(), 1L);
|
||||||
BlockInfo storedBlock = bm.getStoredBlock(block.getBlock().getLocalBlock());
|
BlockInfo storedBlock = bm.getStoredBlock(block.getBlock().getLocalBlock());
|
||||||
assertEquals(bm.pendingReconstruction.getNumReplicas(storedBlock), 2);
|
assertEquals(bm.pendingReconstruction.getNumReplicas(storedBlock), 2);
|
||||||
|
} finally {
|
||||||
|
cluster.getNamesystem().writeUnlock();
|
||||||
|
}
|
||||||
|
|
||||||
// 4. delete the file
|
// 4. delete the file
|
||||||
fs.delete(filePath, true);
|
fs.delete(filePath, true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user