NO-JIRA Fixing intermittent failure in PagingTest

receiveImmediate will issue a depage but it might not be available right away.
A retry needs to be done.
This commit is contained in:
Clebert Suconic 2022-10-22 22:50:39 -04:00
parent e1903bf67c
commit c199902cde
1 changed files with 3 additions and 2 deletions

View File

@ -2492,7 +2492,7 @@ public class PagingTest extends ActiveMQTestBase {
}
@Test
public void testReceiveImmediate() throws Exception {
public void testReceive() throws Exception {
clearDataRecreateServerDirs();
Configuration config = createDefaultInVMConfig().setJournalSyncNonTransactional(false);
@ -2564,7 +2564,8 @@ public class PagingTest extends ActiveMQTestBase {
for (int msgCount = 0; msgCount < numberOfMessages; msgCount++) {
logger.debug("Received {}", msgCount);
msgReceived++;
ClientMessage msg = consumer.receiveImmediate();
Wait.assertTrue(() -> queue.peekFirstMessage() != null, 2000, 100);
ClientMessage msg = consumer.receive(1000);
if (msg == null) {
logger.debug("It's null. leaving now");
sessionConsumer.commit();