chia7712 commented on code in PR #18725: URL: https://github.com/apache/kafka/pull/18725#discussion_r1949798227
########## core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala: ########## @@ -5977,6 +5980,67 @@ class ReplicaManagerTest { ) } + @Test + def testDelayedShareFetchPurgatoryOperationExpiration(): Unit = { + val mockLogMgr = TestUtils.createLogManager(config.logDirs.map(new File(_))) + val rm = new ReplicaManager( Review Comment: As a reminder, it's crucial to utilize a `try-finally` block to ensure proper closure of the `ReplicaManager`. Failing to do so can result in an unreleased thread from the purgatory, potentially leading to errors in subsequent integration tests that incorporate thread leak detection. ``` org.opentest4j.AssertionFailedError: Found 1 unexpected threads during @BeforeAll: executor-ShareFetch ==> expected: <true> but was: <false> ``` Also, the error can be reproduced by following command. ``` ./gradlew core:test --tests ReplicaManagerTest --tests SaslApiVersionsRequestTest --tests LeaderEpochIntegrationTest --tests RequestQuotaTest -PmaxParallelForks=1 ``` I will fix it in https://issues.apache.org/jira/browse/KAFKA-18770 -- 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