From 76f6c9c3bda35f918865bc273672e12021efcaf6 Mon Sep 17 00:00:00 2001 From: jbertram Date: Thu, 19 May 2016 11:49:51 -0500 Subject: [PATCH] Make a few tests more robust --- .../activemq/artemis/cli/commands/etc/amqp-acceptor.txt | 8 ++++++++ .../artemis/cli/commands/etc/hornetq-acceptor.txt | 2 ++ .../activemq/artemis/cli/commands/etc/mqtt-acceptor.txt | 8 ++++++++ .../activemq/artemis/cli/commands/etc/stomp-acceptor.txt | 8 ++++++++ .../activemq/artemis/tests/util/ActiveMQTestBase.java | 2 +- .../tests/integration/cluster/failover/FailoverTest.java | 2 +- .../integration/management/ActiveMQServerControlTest.java | 2 +- .../tests/integration/server/ScaleDown3NodeTest.java | 4 ++-- 8 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/amqp-acceptor.txt create mode 100644 artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/hornetq-acceptor.txt create mode 100644 artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/mqtt-acceptor.txt create mode 100644 artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/stomp-acceptor.txt diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/amqp-acceptor.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/amqp-acceptor.txt new file mode 100644 index 0000000000..566c29ea78 --- /dev/null +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/amqp-acceptor.txt @@ -0,0 +1,8 @@ + + + ${nanoseconds} diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/hornetq-acceptor.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/hornetq-acceptor.txt new file mode 100644 index 0000000000..e24b102893 --- /dev/null +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/hornetq-acceptor.txt @@ -0,0 +1,2 @@ + + tcp://${host}:${hq.port}?protocols=HORNETQ,STOMP \ No newline at end of file diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/mqtt-acceptor.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/mqtt-acceptor.txt new file mode 100644 index 0000000000..566c29ea78 --- /dev/null +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/mqtt-acceptor.txt @@ -0,0 +1,8 @@ + + + ${nanoseconds} diff --git a/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/stomp-acceptor.txt b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/stomp-acceptor.txt new file mode 100644 index 0000000000..566c29ea78 --- /dev/null +++ b/artemis-cli/src/main/resources/org/apache/activemq/artemis/cli/commands/etc/stomp-acceptor.txt @@ -0,0 +1,8 @@ + + + ${nanoseconds} diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java index ee002298f6..082a3aa722 100644 --- a/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java +++ b/artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java @@ -591,7 +591,7 @@ public abstract class ActiveMQTestBase extends Assert { break; } } - } while (i++ <= 30 && hasValue); + } while (i++ <= 50 && hasValue); for (WeakReference ref : references) { Assert.assertNull(ref.get()); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java index 8b78f3d178..229136acd0 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java @@ -332,7 +332,7 @@ public class FailoverTest extends FailoverTestBase { // https://issues.jboss.org/browse/HORNETQ-685 @Test public void testTimeoutOnFailoverTransactionCommit() throws Exception { - locator.setCallTimeout(2000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(-1); + locator.setCallTimeout(5000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(-1); ((InVMNodeManager) nodeManager).failoverPause = 5000L; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java index 4a9ca24d04..5595ddf657 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java @@ -900,7 +900,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase { ClientProducer producer1 = session.createProducer(random1); ClientProducer producer2 = session.createProducer(random2); - ClientMessage message = session.createMessage(false); + ClientMessage message = session.createMessage(true); producer1.send(message); producer2.send(message); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java index 49ed8a228a..cc6055f867 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/server/ScaleDown3NodeTest.java @@ -347,12 +347,12 @@ public class ScaleDown3NodeTest extends ClusterTestBase { Assert.assertEquals(TEST_SIZE * 2, messageCount); for (int i = 0; i < TEST_SIZE; i++) { - ClientMessage clientMessage = consumers[0].getConsumer().receive(250); + ClientMessage clientMessage = consumers[0].getConsumer().receive(1000); Assert.assertNotNull(clientMessage); IntegrationTestLogger.LOGGER.info("Received: " + clientMessage); clientMessage.acknowledge(); - clientMessage = consumers[1].getConsumer().receive(250); + clientMessage = consumers[1].getConsumer().receive(1000); Assert.assertNotNull(clientMessage); IntegrationTestLogger.LOGGER.info("Received: " + clientMessage); clientMessage.acknowledge();