Skip to content

Commit

Permalink
NO-JIRA fixing eventual test race on LVQTest::testSimple
Browse files Browse the repository at this point in the history
  • Loading branch information
clebertsuconic committed Nov 21, 2024
1 parent 20a115f commit 72dae9e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ public void testSimple() throws Exception {
m2.putStringProperty(Message.HDR_LAST_VALUE_NAME, rh);
producer.send(m1);
producer.send(m2);

Queue lvQueue = server.locateQueue(qName1);
// delivering is asynchronous. We have to make sure that all messages were sent
Wait.assertEquals(2L, lvQueue::getMessagesAdded, 5000, 100);
// messages were replaced by the LVQ so it should have only one
Wait.assertEquals(1L, lvQueue::getMessageCount, 5000, 100);
Wait.assertEquals(1L, lvQueue::getMessagesReplaced, 5000, 100);

clientSession.start();
ClientMessage m = consumer.receive(1000);
assertNotNull(m);
Expand Down

0 comments on commit 72dae9e

Please sign in to comment.