Rancho-7 commented on code in PR #19966: URL: https://github.com/apache/kafka/pull/19966#discussion_r2147947430
########## core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala: ########## @@ -2833,6 +2592,7 @@ class ReplicaManagerTest { allLogs.put(topicPartitionObj, mockLog) when(mockLogMgr.allLogs).thenReturn(allLogs.values.asScala) when(mockLogMgr.isLogDirOnline(anyString)).thenReturn(true) + when(mockLogMgr.directoryId(anyString)).thenReturn(None) Review Comment: in the test `testFollowerFetchWithDefaultSelectorNoForcedHwPropagation`,we use `prepareReplicaManagerAndLogManager` to mock the replicaManager instead of `setupReplicaManagerWithMockedPurgatories`. Without this change, it results in a NPE at https://github.com/apache/kafka/blob/081deaa1a96710f2d58e094cf92ba92478c6dcba/core/src/main/scala/kafka/server/ReplicaManager.scala#L2942 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org