Sure @lindong28, I believe the issue we were seeing was that 
`producer.send(record)` would fail silently because we were not calling 
`producer.send(record).get()`, but 
`producer.partitionsFor(topic).asScala.find(_.partition() == 
0).get.leader().id() != leaderServerId` would return true anyway. Because the 
producer send was never retried, the test below times out
```
    // Consumer should receive some messages
    TestUtils.waitUntilTrue(() => {
      consumer.poll(0).count() > 0
    }, "Expected some messages", 3000L)
```

This PR ensures that both 
`producer.partitionsFor(topic).asScala.find(_.partition() == 
0).get.leader().id() != leaderServerId`  passes and we successfully send a 
record before breaking out of the `waitUntilTrue` loop and progressing to the 
rest of the test.


[ Full content available at: https://github.com/apache/kafka/pull/5695 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to