You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2017/03/10 03:20:18 UTC

[5/6] activemq-artemis git commit: ARTEMIS-1029 speeding up JmsNettyNioStressTest

ARTEMIS-1029 speeding up JmsNettyNioStressTest


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/6a323eb8
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/6a323eb8
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/6a323eb8

Branch: refs/heads/master
Commit: 6a323eb832c48c9e958368851e7d3330ed3257d3
Parents: b73828a
Author: Clebert Suconic <cl...@apache.org>
Authored: Thu Mar 9 21:53:14 2017 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Thu Mar 9 22:12:59 2017 -0500

----------------------------------------------------------------------
 .../integration/client/JmsNettyNioStressTest.java | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6a323eb8/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
index ac1163d..081dc79 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JmsNettyNioStressTest.java
@@ -41,6 +41,7 @@ import org.apache.activemq.artemis.api.core.RoutingType;
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
 import org.apache.activemq.artemis.jms.client.ActiveMQDestination;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.tests.util.Wait;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -111,9 +112,9 @@ public class JmsNettyNioStressTest extends ActiveMQTestBase {
       final int numberOfMessages = 100;
 
       // these must all be the same
-      final int numProducers = 30;
-      final int numConsumerProducers = 30;
-      final int numConsumers = 30;
+      final int numProducers = 5;
+      final int numConsumerProducers = 5;
+      final int numConsumers = 5;
 
       // each produce, consume+produce and consume increments this counter
       final AtomicInteger totalCount = new AtomicInteger(0);
@@ -261,15 +262,8 @@ public class JmsNettyNioStressTest extends ActiveMQTestBase {
          }.start();
       }
 
-      // check that the overall transaction count reaches the expected number,
-      // which would indicate that the system didn't stall
-      int timeoutCounter = 0;
-      int maxSecondsToWait = 60;
-      while (timeoutCounter < maxSecondsToWait && totalCount.get() < totalExpectedCount) {
-         timeoutCounter++;
-         Thread.sleep(1000);
-         System.out.println("Not done yet.. " + (maxSecondsToWait - timeoutCounter) + "; " + totalCount.get());
-      }
+      Wait.waitFor(() -> totalExpectedCount == totalCount.get(), 60000, 100);
+
       System.out.println("Done.." + totalCount.get() + ", expected " + totalExpectedCount);
       Assert.assertEquals("Possible deadlock", totalExpectedCount, totalCount.get());
       System.out.println("After assert");