You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "kirktrue (via GitHub)" <gi...@apache.org> on 2024/07/29 22:32:57 UTC
Re: [PR] KAFKA-17209: Revisit testCurrentLag for asyncConsumer [kafka]
kirktrue commented on code in PR #16703:
URL: https://github.com/apache/kafka/pull/16703#discussion_r1696033289
##########
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_.
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org