TaiJuWu commented on code in PR #16703:
URL: https://github.com/apache/kafka/pull/16703#discussion_r1697677735
##########
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java:
##########
@@ -2491,7 +2508,8 @@ public void testCurrentLag(GroupProtocol groupProtocol) {
client.respond(listOffsetsResponse(singletonMap(tp0, 90L)));
consumer.poll(Duration.ofMillis(0));
- assertEquals(OptionalLong.of(40L), consumer.currentLag(tp0));
+ TestUtils.waitForCondition(() ->
OptionalLong.of(40L).equals(consumer.currentLag(tp0)),
+ "Consumer can't get excepted lag.");
Review Comment:
> While this change may allow the test to pass, it suggests to me that the
new consumer is not keeping the semantics for the `currentLag()` API, in that
it should return the correct value _immediately_, not _eventually_.
Hi @kirktrue ,thanks for review.
I think this condition can be removed, let's test with CI.
--
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]