diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 5739f6b5667..ebe688285a3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -715,6 +715,10 @@ Release 2.8.0 - UNRELEASED HDFS-8647. Abstract BlockManager's rack policy into BlockPlacementPolicy. (Brahma Reddy Battula via mingma) + HDFS-9225. Fix intermittent test failure of + TestBlockManager.testBlocksAreNotUnderreplicatedInSingleRack. + (Masatake Iwasaki via wang) + OPTIMIZATIONS HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java index 9de62c6ecad..3a55cc4dda1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestBlockManager.java @@ -100,6 +100,7 @@ public class TestBlockManager { fsn = Mockito.mock(FSNamesystem.class); Mockito.doReturn(true).when(fsn).hasWriteLock(); Mockito.doReturn(true).when(fsn).hasReadLock(); + Mockito.doReturn(true).when(fsn).isRunning(); bm = new BlockManager(fsn, conf); final String[] racks = { "/rackA", @@ -373,9 +374,8 @@ public class TestBlockManager { List origNodes) throws Exception { assertEquals(0, bm.numOfUnderReplicatedBlocks()); - addBlockOnNodes(testIndex, origNodes); - bm.processMisReplicatedBlocks(); - assertEquals(0, bm.numOfUnderReplicatedBlocks()); + BlockInfo block = addBlockOnNodes(testIndex, origNodes); + assertFalse(bm.isNeededReplication(block, bm.countLiveNodes(block))); }