alanlau28 opened a new pull request, #23327: URL: https://github.com/apache/kafka/pull/23327
testReturnRecordsDuringRebalance is flaky for the classic consumer due to the same heartbeat-vs-application-thread race addressed in KAFKA-16630: a poll() can momentarily return no records, or return a buffered record before the rebalance assignment has reconciled. As a result the test's single poll(Duration.ZERO) calls occasionally returned zero records, and the step that only counted a record once the assignment had settled dropped a record that arrived early and then timed out waiting for it. The affected steps now poll until the expected records are returned using TestUtils.waitForCondition, and count each polled record independently of the assignment check so an early record is no longer lost. This is a test-only change. The flakiness was reproduced locally at a high rate under a tight repeat loop; after the fix the test passed 2000 stress iterations and 300 consecutive full test-task runs with no failures. -- 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]
