You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "TaiJuWu (via GitHub)" <gi...@apache.org> on 2024/07/27 07:26:35 UTC
[PR] [Don't merge] Revisit currentLag [kafka]
TaiJuWu opened a new pull request, #16703:
URL: https://github.com/apache/kafka/pull/16703
*More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.*
*Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.*
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
--
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
Re: [PR] KAFKA-17209: Revisit testCurrentLag for asyncConsumer [kafka]
Posted by "TaiJuWu (via GitHub)" <gi...@apache.org>.
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-17209: Revisit testCurrentLag for asyncConsumer [kafka]
Posted by "TaiJuWu (via GitHub)" <gi...@apache.org>.
TaiJuWu closed pull request #16703: KAFKA-17209: Revisit testCurrentLag for asyncConsumer
URL: https://github.com/apache/kafka/pull/16703
--
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
Re: [PR] KAFKA-17209: Revisit testCurrentLag for asyncConsumer [kafka]
Posted by "kirktrue (via GitHub)" <gi...@apache.org>.
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
Re: [PR] KAFKA-17209: Revisit testCurrentLag for asyncConsumer [kafka]
Posted by "TaiJuWu (via GitHub)" <gi...@apache.org>.
TaiJuWu commented on PR #16703:
URL: https://github.com/apache/kafka/pull/16703#issuecomment-2259326018
> wallpapering
Hi @kirktrue , thanks for your review and comments.
I removed `if` statement and rewrite `waitForUntil` condition, let's test on 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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org