showuon commented on code in PR #15132:
URL: https://github.com/apache/kafka/pull/15132#discussion_r1442472935


##########
core/src/test/scala/unit/kafka/server/KafkaApisTest.scala:
##########
@@ -1669,12 +1671,16 @@ class KafkaApisTest extends Logging {
       val request = buildRequest(offsetCommitRequest)
       
when(clientRequestQuotaManager.maybeRecordAndGetThrottleTimeMs(any[RequestChannel.Request](),
         any[Long])).thenReturn(0)
-      kafkaApis = createKafkaApis()
-      kafkaApis.handleOffsetCommitRequest(request, 
RequestLocal.withThreadConfinedCaching)
-
-      val response = verifyNoThrottling[OffsetCommitResponse](request)
-      assertEquals(Errors.UNKNOWN_TOPIC_OR_PARTITION,
-        
Errors.forCode(response.data.topics().get(0).partitions().get(0).errorCode))
+      val kafkaApis = createKafkaApis()

Review Comment:
   This kafkaApis instance is created inside a sub-function. 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

Reply via email to