jingjia88 commented on code in PR #19868: URL: https://github.com/apache/kafka/pull/19868#discussion_r2118648890
########## core/src/test/scala/integration/kafka/api/AbstractConsumerTest.scala: ########## @@ -94,12 +94,18 @@ abstract class AbstractConsumerTest extends BaseRequestTest { def awaitNonEmptyRecords[K, V](consumer: Consumer[K, V], partition: TopicPartition, pollTimeoutMs: Long = 100): ConsumerRecords[K, V] = { + var result: ConsumerRecords[K, V] = null + TestUtils.pollRecordsUntilTrue(consumer, (polledRecords: ConsumerRecords[K, V]) => { - if (polledRecords.records(partition).asScala.nonEmpty) - return polledRecords - false + if (polledRecords.records(partition).asScala.nonEmpty) { + result = polledRecords + true + } else { + false + } Review Comment: Updated, thanks for the feedback! PTAL~ -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org