lianetm commented on code in PR #16982:
URL: https://github.com/apache/kafka/pull/16982#discussion_r1728850049
##########
clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java:
##########
@@ -2471,6 +2477,8 @@ public void testCurrentLag(GroupProtocol groupProtocol) {
// poll once to update with the current metadata
consumer.poll(Duration.ofMillis(0));
+ TestUtils.waitForCondition(() ->
client.requests().stream().anyMatch(request ->
request.requestBuilder().apiKey().equals(ApiKeys.FIND_COORDINATOR)),
Review Comment:
interesting, makes sense how you keep a single poll, and we just have to
wait a bit for the background to actually generate the request. What about
encapsulating this bit to make it clearer in all places it's used, to end up
with something like:
`TestUtils.waitForCondition(() ->
requestGenerated(ApiKeys.FIND_COORDINATOR))`
--
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]