You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2019/05/10 19:11:10 UTC

[activemq-artemis] branch master updated: NO-JIRA speeding up PagingReceiveTest

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

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


The following commit(s) were added to refs/heads/master by this push:
     new d213aea  NO-JIRA speeding up PagingReceiveTest
d213aea is described below

commit d213aea96b831fe713be792e8df21238c96cd61e
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Fri May 10 14:45:57 2019 -0400

    NO-JIRA speeding up PagingReceiveTest
---
 .../tests/integration/paging/PagingReceiveTest.java        | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingReceiveTest.java
index 347f3e4..140b35f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingReceiveTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingReceiveTest.java
@@ -32,6 +32,7 @@ import org.apache.activemq.artemis.api.core.RoutingType;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
+import org.apache.activemq.artemis.junit.Wait;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.junit.Before;
 import org.junit.Test;
@@ -44,7 +45,7 @@ public class PagingReceiveTest extends ActiveMQTestBase {
 
    private ServerLocator locator;
 
-   private int numMsgs = 500;
+   private int numMsgs = 100;
 
    protected boolean isNetty() {
       return false;
@@ -89,13 +90,9 @@ public class PagingReceiveTest extends ActiveMQTestBase {
       PageSubscription pageSub = store.getCursorProvider().getSubscription(qid);
       long pageNr = store.getCurrentWritingPage();
 
-      PageSubscriptionImpl.PageCursorInfo info = ((PageSubscriptionImpl)pageSub).getPageInfo(pageNr);
-
-      System.out.println("pendingTx: " + info.getPendingTx());
+      Wait.assertTrue(() -> ((PageSubscriptionImpl)pageSub).getPageInfo(pageNr).getPendingTx() > 0);
 
-      //The positive pendingTx will prevent a page being removed
-      //before ResOperation is completed.
-      assertTrue(info.getPendingTx() > 0);
+      PageSubscriptionImpl.PageCursorInfo info = ((PageSubscriptionImpl)pageSub).getPageInfo(pageNr);
 
       session.commit();
       session.close();
@@ -115,11 +112,12 @@ public class PagingReceiveTest extends ActiveMQTestBase {
          queue.getPageSubscription().getPagingStore().forceAnotherPage();
       }
 
+      locator.setBlockOnNonDurableSend(false).setBlockOnAcknowledge(false);
       final ClientSessionFactory sf = createSessionFactory(locator);
       ClientSession session = sf.createSession(null, null, false, true, true, false, 0);
       ClientProducer prod = session.createProducer(ADDRESS);
 
-      for (int i = 0; i < 500; i++) {
+      for (int i = 0; i < numMsgs; i++) {
          ClientMessage msg = session.createMessage(true);
          msg.putIntProperty("key", i);
          prod.send(msg);