Technoboy- opened a new pull request, #17617:
URL: https://github.com/apache/pulsar/pull/17617
Fixes #17120
Master Issue: #17120
### Motivation
The failure assertion is at line 206 :
```
Assert.assertEquals(recvdNumMsgs, topicStats.msgOutCounter);
```
`recvdNumMsgs` must be 10, but `topicStats.msgOutCounter` is from broker
side, coming from dispatcher :
```
writeAndFlushPromise.addListener(status -> {
// only increment counters after the messages have been
successfully written to the TCP/IP connection
if (status.isSuccess()) {
msgOut.recordMultipleEvents(totalMessages, totalBytes);
msgOutCounter.add(totalMessages);
bytesOutCounter.add(totalBytes);
chunkedMessageRate.recordMultipleEvents(totalChunkedMessages, 0);
}
});
```
So we need to use Awaitility for that assertion.
### Modification
- Remove `for` block, use Map.`get`.
- Add cleanup logic in order to run the test many times.
### Documentation
- [x] `doc-not-needed`
(Please explain why)
--
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]