FrankYang0529 opened a new pull request, #16589:
URL: https://github.com/apache/kafka/pull/16589

   Currently, we have many test cases put 
`client.prepareResponseFrom(FindCoordinatorResponse.prepareResponse(...), 
...);` after `newConsumer`. If `FutureResponse` is not in `MockClient`, the 
request can't get a response. This may cause some flaky tests.
    
   When starting a `newConsumer` for `AsyncKafkaConsumer`, it always sends 
`FindCoordinatorRequest`.
    
   In `MockClient#send`, if a `FutureResponse` is missing, the request will be 
added to `requests`. Even if `client.prepareResponseFrom` adds a new 
`FutureResponse`, it can't be matched to an existent request, so the request 
can't get a response.
    
   It's better to put 
`client.prepareResponseFrom(FindCoordinatorResponse.prepareResponse(...), 
...);` before `newConsumer`, so we don't miss any `FindCoordinatorRequest`.
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to