showuon commented on code in PR #15132: URL: https://github.com/apache/kafka/pull/15132#discussion_r1442473158
########## core/src/test/scala/unit/kafka/server/KafkaApisTest.scala: ########## @@ -2061,20 +2071,24 @@ class KafkaApisTest extends Logging { responseCallback.capture(), ArgumentMatchers.eq(requestLocal) )).thenAnswer(_ => responseCallback.getValue.apply(InitProducerIdResult(producerId, epoch, Errors.PRODUCER_FENCED))) - kafkaApis = createKafkaApis() - kafkaApis.handleInitProducerIdRequest(request, requestLocal) - - verify(requestChannel).sendResponse( - ArgumentMatchers.eq(request), - capturedResponse.capture(), - ArgumentMatchers.eq(None) - ) - val response = capturedResponse.getValue + val kafkaApis = createKafkaApis() Review Comment: This instance is created inside a for loop. We need to close it 1 by 1. -- 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