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 07aa5c69f4b..e743a9dc593 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 @@ -153,7 +153,6 @@ public class TestBlockManager { Mockito.when(haContext.getState()).thenReturn(haState); Mockito.when(haState.shouldPopulateReplQueues()).thenReturn(true); Mockito.when(fsn.getHAContext()).thenReturn(haContext); - bm.setInitializedReplQueues(true); CacheManager cm = Mockito.mock(CacheManager.class); Mockito.doReturn(cm).when(fsn).getCacheManager(); GSet cb = @@ -897,10 +896,12 @@ public class TestBlockManager { StorageReceivedDeletedBlocks srdb = new StorageReceivedDeletedBlocks(new DatanodeStorage(ds.getStorageID()), rdbiList.toArray(new ReceivedDeletedBlockInfo[rdbiList.size()])); + bm.setInitializedReplQueues(true); bm.processIncrementalBlockReport(node, srdb); // Needed replications should still be 0. assertEquals("UC block was incorrectly added to needed Replications", 0, bm.neededReplications.size()); + bm.setInitializedReplQueues(false); } private BlockInfo addBlockToBM(long blkId) {