Skip to content

Commit

Permalink
[fix][test]Fix flaky test V1_ProducerConsumerTest.testConcurrentConsu…
Browse files Browse the repository at this point in the history
…merReceiveWhileReconnect
  • Loading branch information
poorbarcode committed Feb 24, 2025
1 parent 35c9fec commit 11865d1
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,11 @@ public Void call() throws Exception {
restartBroker();

// The available permits should be 10 and num messages in the queue should be 90
Awaitility.await().untilAsserted(() ->
Assert.assertEquals(consumerImpl.getAvailablePermits(), numConsumersThreads));
Assert.assertEquals(consumerImpl.numMessagesInQueue(), recvQueueSize - numConsumersThreads);
Awaitility.await().untilAsserted(() -> {
Assert.assertEquals(consumerImpl.getAvailablePermits(), numConsumersThreads);
Assert.assertEquals(consumerImpl.numMessagesInQueue(), recvQueueSize - numConsumersThreads);
});

consumer.close();
}

Expand Down

0 comments on commit 11865d1

Please sign in to comment.