johnnychhsu opened a new pull request, #15828: URL: https://github.com/apache/kafka/pull/15828
## Context ControllerRegistrationManagerTest is flaky due to the poll in L221. The potential root cause is a race condition between the first poll (L221) and the second poll (L229). Before the second poll, we mock a response (L226), which should be processed by the second poll. However, if the first poll take this away, the second poll would get nothing, and this could lead to an error. Jira: https://issues.apache.org/jira/browse/KAFKA-15897 ## Solution Remove the first poll since it is not necessary. We can check the manager status with `rpcStats` without polling. ## Test test with `./gradlew clean core:test --tests ControllerRegistrationManagerTest` and passed ### 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org