Skip to content

Commit

Permalink
Reduce Flakyness in PersistentStickyKeyDispatcherMultipleConsumersTest
Browse files Browse the repository at this point in the history
  • Loading branch information
eolivelli committed Jul 28, 2022
1 parent af5441c commit 39fc69a
Showing 1 changed file with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,21 @@ public void testSendMarkerMessage() {
fail("Failed to readEntriesComplete.", e);
}

ArgumentCaptor<Integer> totalMessagesCaptor = ArgumentCaptor.forClass(Integer.class);
verify(consumerMock, times(1)).sendMessages(
anyList(),
any(EntryBatchSizes.class),
any(EntryBatchIndexesAcks.class),
totalMessagesCaptor.capture(),
anyLong(),
anyLong(),
any(RedeliveryTracker.class)
);

List<Integer> allTotalMessagesCaptor = totalMessagesCaptor.getAllValues();
Assert.assertEquals(allTotalMessagesCaptor.get(0).intValue(), 5);
Awaitility.await().untilAsserted(() -> {
ArgumentCaptor<Integer> totalMessagesCaptor = ArgumentCaptor.forClass(Integer.class);
verify(consumerMock, times(1)).sendMessages(
anyList(),
any(EntryBatchSizes.class),
any(EntryBatchIndexesAcks.class),
totalMessagesCaptor.capture(),
anyLong(),
anyLong(),
any(RedeliveryTracker.class)
);

List<Integer> allTotalMessagesCaptor = totalMessagesCaptor.getAllValues();
Assert.assertEquals(allTotalMessagesCaptor.get(0).intValue(), 5);
});
}

@Test(timeOut = 10000)
Expand Down

0 comments on commit 39fc69a

Please sign in to comment.