[ 
https://issues.apache.org/jira/browse/KAFKA-17129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chia-Ping Tsai resolved KAFKA-17129.
------------------------------------
    Fix Version/s: 3.9.0
       Resolution: Fixed

> Revisit FindCoordinatorResponse in KafkaConsumerTest
> ----------------------------------------------------
>
>                 Key: KAFKA-17129
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17129
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: clients, consumer
>            Reporter: PoAn Yang
>            Assignee: PoAn Yang
>            Priority: Major
>             Fix For: 3.9.0
>
>
> 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.
>  
> In our KafkaConsumerTest design, when starting a `newConsumer` for 
> `AsyncKafkaConsumer`, it always sends `FindCoordinatorRequest`.
>  
> In `MockClient#send`, if a `FutureResponse` is missing, the request will be 
> add 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`.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to