forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flakiness in ProducerSemaphoreTest (apache#6285)
The test was asserting on the value of the semaphore, when this value depended on how quickly the broker responds. I fixed this by making the producers channel unreadable before sending the messages. Even if the broker responds, the client won't see the response until the channel is made readable again, so we can reliably check the value of the semaphore. For testEnsureNotBlockOnPendingQueue, I switched it to throw on full rather than block on full because whether something is blocking is hard to assert for in a test. Finally, there was a bug in testEnsureNotBlockOnPendingQueue where waitForAll() was called but nothing was done with the returned future. This is a really badly named utility, as the name implies that the method itself does the waiting. It should be renamed.
- Loading branch information
Showing
1 changed file
with
88 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters