chia7712 commented on code in PR #19489:
URL: https://github.com/apache/kafka/pull/19489#discussion_r2634218117


##########
clients/src/test/java/org/apache/kafka/clients/producer/internals/SenderTest.java:
##########
@@ -2686,14 +2687,12 @@ public void testResetNextBatchExpiry() throws Exception 
{
         inOrder.verify(client, atLeastOnce()).newClientRequest(anyString(), 
any(), anyLong(), anyBoolean(), anyInt(), any());
         inOrder.verify(client, atLeastOnce()).send(any(), anyLong());
         inOrder.verify(client).poll(eq(0L), anyLong());
-        inOrder.verify(client).poll(eq(accumulator.getDeliveryTimeoutMs()), 
anyLong());

Review Comment:
   >  poll is invoked with (maxLong - now)
   
   Yes, `nextExpiryTimeMs` is reset to `Long.MAX_VALUE`, and the timeout is 
calculated as `nextExpiryTimeMs` minus `now`
   
   ```java
           pollTimeout = Math.min(pollTimeout, 
this.accumulator.nextExpiryTimeMs() - now);
   ```
   
   @gongxuanzhang Is 
`inOrder.verify(client).poll(eq(accumulator.nextExpiryTimeMs() - 
nowBeforeSecondRun), anyLong());` more suitable?
   



-- 
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