apoorvmittal10 commented on code in PR #23221:
URL: https://github.com/apache/kafka/pull/23221#discussion_r3843800391


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/FetcherTest.java:
##########
@@ -2829,6 +2829,11 @@ public void testFetcherConcurrency() throws Exception {
         LogContext logContext = new LogContext();
         buildDependencies(new MetricConfig(), Long.MAX_VALUE, new 
SubscriptionState(logContext, AutoOffsetResetStrategy.EARLIEST), logContext);
 
+        // Replace the Mockito spy from buildDependencies() with a plain 
instance: sendFetches()/poll() below
+        // are called on every spin of a tight busy-wait, and the per-call 
cost of Mockito's real-method
+        // interception on that many invocations can make a run slow enough to 
hit GC overhead limits.
+        consumerClient = new ConsumerNetworkClient(logContext, client, 
metadata, time, 100, 1000, Integer.MAX_VALUE);

Review Comment:
   Just confirming, do we close the `ConsumerNetworkClient` in tests, I cannot 
find from where the `consumerClient` created in `buildDependencies` method is 
being closed in tests?
   
   If it's not being closed then shouldn't we? If it's being closed then after 
this change as we are overriding the `consumerClient` hence the previous one 
will not be closed. May be we need an overriden `buildDependencies` method to 
not create `consumerClient` always, as in the PR fixed test.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to