merlimat opened a new pull request #7073: URL: https://github.com/apache/pulsar/pull/7073
### Motivation There was a race in testRelativeMessageRateLimitingThrottling where the test was sending and receiving a message to warmup the broker, and then testing whether messages could get through with a 1/s dispatch rate but a high produce rate. The race triggered when the initial warmup message triggered a backoff because the initial warmup receive already used up the 1/s permit quota. This happened because when the dispatcher has read messages from the managed ledger, it will call #readMoreEntries. If this call to readMoreEntries occurs before the test starts publishing the backoff is hit. The solution is to change to way we validate the functionallity at the end of the test. The test really wants to verify that if there are a lot of messages being produced we can keep up. We should only hit the backoff once. So instead of calling receive with a 100ms timeout, set a max deadline for all the messages to have been delivered by. This timeout should take into account the possibility of a backoff occurring, so it is set to 1.1 seconds. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org