This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new c199902cde NO-JIRA Fixing intermittent failure in PagingTest
c199902cde is described below

commit c199902cde0e07450009a6717195936757cbec34
Author: Clebert Suconic <[email protected]>
AuthorDate: Sat Oct 22 22:50:39 2022 -0400

    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.
---
 .../apache/activemq/artemis/tests/integration/paging/PagingTest.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
index f45d3c9751..0752dc999b 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingTest.java
@@ -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();

Reply via email to