Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.9.0
    • clients, consumer
    • None

    Description

      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`.

      Attachments

        Issue Links

          Activity

            People

              yangpoan PoAn Yang
              yangpoan PoAn Yang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: