activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject activemq-artemis git commit: Improving up time of some tests
Date Tue, 23 Jun 2015 20:36:01 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master 1492fe7ad -> 077a416ee


Improving up time of some tests


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

Branch: refs/heads/master
Commit: 077a416ee0d06c326bcc10f5b3251315ae7d015e
Parents: 1492fe7
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Tue Jun 23 12:42:50 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Jun 23 16:35:44 2015 -0400

----------------------------------------------------------------------
 .../core/paging/impl/PagingStoreImpl.java       |  2 +-
 .../tests/extras/byteman/PagingLeakTest.java    | 16 +++++----
 .../integration/client/LargeMessageTest.java    | 12 +++----
 .../integration/cluster/bridge/BridgeTest.java  | 37 +++++++++-----------
 4 files changed, 32 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/077a416e/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
index 78cbbc3..3b0a139 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
@@ -168,7 +168,7 @@ public class PagingStoreImpl implements PagingStore
 
       this.syncNonTransactional = syncNonTransactional;
 
-      if (scheduledExecutor != null)
+      if (scheduledExecutor != null && syncTimeout > 0)
       {
          this.syncTimer = new PageSyncTimer(this, scheduledExecutor, syncTimeout);
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/077a416e/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingLeakTest.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingLeakTest.java
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingLeakTest.java
index f1f3356..0bbebc8 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingLeakTest.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/PagingLeakTest.java
@@ -89,6 +89,7 @@ public class PagingLeakTest extends ActiveMQTestBase
       )
    public void testValidateLeak() throws Throwable
    {
+      System.out.println("location::" + getBindingsDir());
 
       List<PagePositionImpl> positions = new ArrayList<PagePositionImpl>();
 
@@ -121,13 +122,15 @@ public class PagingLeakTest extends ActiveMQTestBase
       // A backup that will be waiting to be activated
       Configuration config = createDefaultNettyConfig();
 
+      config.setJournalBufferTimeout_AIO(0).setJournalBufferTimeout_NIO(0);
+
       final ActiveMQServer server = addServer(ActiveMQServers.newActiveMQServer(config, true));
 
       server.start();
 
       AddressSettings settings = new AddressSettings()
-              .setPageSizeBytes(20 * 1024)
-              .setMaxSizeBytes(200 * 1024)
+              .setPageSizeBytes(2 * 1024)
+              .setMaxSizeBytes(20 * 1024)
               .setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
 
       server.getAddressSettingsRepository().addMatch("#", settings);
@@ -199,9 +202,9 @@ public class PagingLeakTest extends ActiveMQTestBase
       }
 
 
-      int numberOfMessages = 10000;
+      int numberOfMessages = 500;
 
-      Consumer consumer1 = new Consumer(100, "-1", 150);
+      Consumer consumer1 = new Consumer(10, "-1", 150);
       Consumer consumer2 = new Consumer(0, "-2", numberOfMessages);
 
       final ServerLocator locator = createInVMLocator(0);
@@ -219,20 +222,21 @@ public class PagingLeakTest extends ActiveMQTestBase
          msg.getBodyBuffer().writeBytes(b);
          producer.send(msg);
 
-         if (i == 1000)
+         if (i == 100)
          {
             System.out.println("Starting consumers!!!");
             consumer1.start();
             consumer2.start();
          }
 
-         if (i % 1000 == 0)
+         if (i % 250 == 0)
          {
             validateInstances();
          }
 
       }
 
+      System.out.println("Sent " + numberOfMessages);
 
       consumer1.join();
       consumer2.join();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/077a416e/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
index af157f9..10e1324 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/LargeMessageTest.java
@@ -110,7 +110,7 @@ public class LargeMessageTest extends LargeMessageTestBase
       AddressSettings settings = new AddressSettings();
       if (redeliveryDelay)
       {
-         settings.setRedeliveryDelay(1000);
+         settings.setRedeliveryDelay(100);
          if (locator.isCompressLargeMessage())
          {
             locator.setConsumerWindowSize(0);
@@ -2781,9 +2781,9 @@ public class LargeMessageTest extends LargeMessageTestBase
 
       final int numberOfBytesBigMessage = 400000;
 
-      locator.setBlockOnNonDurableSend(true)
-              .setBlockOnDurableSend(true)
-              .setBlockOnAcknowledge(true)
+      locator.setBlockOnNonDurableSend(false)
+              .setBlockOnDurableSend(false)
+              .setBlockOnAcknowledge(false)
               .setCompressLargeMessage(true);
 
       ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
@@ -2864,10 +2864,6 @@ public class LargeMessageTest extends LargeMessageTestBase
                messageLarge.saveToOutputStream(bout);
                byte[] body = bout.toByteArray();
                assertEquals(numberOfBytesBigMessage, body.length);
-               for (int bi = 0; bi < body.length; bi++)
-               {
-                  assertEquals(getSamplebyte(bi), body[bi]);
-               }
             }
 
             session.rollback();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/077a416e/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
index e88a4bf..ede895f 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeTest.java
@@ -239,7 +239,7 @@ public class BridgeTest extends ActiveMQTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(1024 * 1024));
+            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(10 * 1024));
          }
 
          message.putIntProperty(propKey, i);
@@ -259,7 +259,7 @@ public class BridgeTest extends ActiveMQTestBase
 
          if (largeMessage)
          {
-            readMessages(message);
+            readLargeMessages(message, 10);
          }
 
          message.acknowledge();
@@ -362,13 +362,13 @@ public class BridgeTest extends ActiveMQTestBase
          .setName("bridge1")
          .setQueueName(queueName0)
          .setForwardingAddress(forwardAddress)
-         .setRetryInterval(1000)
+         .setRetryInterval(100)
          .setReconnectAttempts(-1)
          .setReconnectAttemptsOnSameNode(-1)
          .setUseDuplicateDetection(false)
          .setConfirmationWindowSize(numMessages * messageSize / 2)
          .setStaticConnectors(connectorConfig)
-         .setCallTimeout(5000);
+         .setCallTimeout(500);
 
       List<BridgeConfiguration> bridgeConfigs = new ArrayList<BridgeConfiguration>();
       bridgeConfigs.add(bridgeConfiguration);
@@ -418,7 +418,7 @@ public class BridgeTest extends ActiveMQTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(1024 * 1024));
+            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(10 * 1024));
          }
 
          message.putIntProperty(propKey, i);
@@ -443,7 +443,7 @@ public class BridgeTest extends ActiveMQTestBase
 
          if (largeMessage)
          {
-            readMessages(message);
+            readLargeMessages(message, 10);
          }
 
          message.acknowledge();
@@ -480,11 +480,11 @@ public class BridgeTest extends ActiveMQTestBase
    /**
     * @param message
     */
-   private void readMessages(final ClientMessage message)
+   private void readLargeMessages(final ClientMessage message, int kiloBlocks)
    {
       byte[] byteRead = new byte[1024];
 
-      for (int j = 0; j < 1024; j++)
+      for (int j = 0; j < kiloBlocks; j++)
       {
          message.getBodyBuffer().readBytes(byteRead);
       }
@@ -603,7 +603,7 @@ public class BridgeTest extends ActiveMQTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(1024 * 1024));
+            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(10 * 1024));
          }
 
          producer0.send(message);
@@ -621,7 +621,7 @@ public class BridgeTest extends ActiveMQTestBase
 
          if (largeMessage)
          {
-            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(1024 * 1024));
+            message.setBodyInputStream(ActiveMQTestBase.createFakeLargeStream(10 * 1024));
          }
 
          producer0.send(message);
@@ -641,7 +641,7 @@ public class BridgeTest extends ActiveMQTestBase
 
          if (largeMessage)
          {
-            readMessages(message);
+            readLargeMessages(message, 10);
          }
       }
 
@@ -1333,9 +1333,9 @@ public class BridgeTest extends ActiveMQTestBase
       ActiveMQServer server0 = null;
       ActiveMQServer server1 = null;
 
-      final int PAGE_MAX = 100 * 1024;
+      final int PAGE_MAX = 10 * 1024;
 
-      final int PAGE_SIZE = 10 * 1024;
+      final int PAGE_SIZE = 1 * 1024;
       try
       {
 
@@ -1345,6 +1345,7 @@ public class BridgeTest extends ActiveMQTestBase
          Map<String, Object> server1Params = new HashMap<String, Object>();
          addTargetParameters(server1Params);
          server1 = createClusteredServerWithParams(isNetty(), 1, true, PAGE_SIZE, PAGE_MAX,
server1Params);
+         server1.getConfiguration().setJournalBufferTimeout_AIO(0).setJournalBufferTimeout_NIO(0);
 
          final String testAddress = "testAddress";
          final String queueName0 = "queue0";
@@ -1359,7 +1360,7 @@ public class BridgeTest extends ActiveMQTestBase
 
          server0.getConfiguration().setConnectorConfigurations(connectors);
 
-         server0.getConfiguration().setIDCacheSize(20000);
+         server0.getConfiguration().setIDCacheSize(20000).setJournalBufferTimeout_NIO(0).setJournalBufferTimeout_AIO(0);
 
          ArrayList<String> staticConnectors = new ArrayList<String>();
          staticConnectors.add(server1tc.getName());
@@ -1420,7 +1421,7 @@ public class BridgeTest extends ActiveMQTestBase
 
          session1.start();
 
-         final int numMessages = 6000;
+         final int numMessages = 200;
 
          final SimpleString propKey = new SimpleString("testkey");
 
@@ -1570,11 +1571,7 @@ public class BridgeTest extends ActiveMQTestBase
       public synchronized boolean intercept(Packet packet, RemotingConnection connection)
throws ActiveMQException
       {
 
-         if (packet instanceof SessionSendMessage && count == 1000)
-         {
-            System.out.println("Going to kill the server");
-         }
-         if (packet instanceof SessionSendMessage && ++count == 5000)
+         if (packet instanceof SessionSendMessage && ++count == 100)
          {
             try
             {


Mime
View raw message