From 8574f9949f7eed73192423ab1f3d185389c638ec Mon Sep 17 00:00:00 2001 From: Erich Duda Date: Thu, 8 Jun 2017 10:44:04 +0200 Subject: [PATCH] ARTEMIS-1208 Do not use reconnect-atempts=-1 in tests (cherry picked from commit 30e8ca656ccc975d35704b3a6c1d676f5e9897ba) --- .../tests/extras/byteman/BMFailoverTest.java | 2 +- .../jms/bridge/ClusteredBridgeTestBase.java | 4 +-- ...BMultipleHandlersServerDisconnectTest.java | 4 +-- .../integration/client/ConsumerTest.java | 4 +-- .../client/ServerLocatorConnectTest.java | 4 +-- .../client/TemporaryQueueTest.java | 2 +- .../cluster/distribution/ClusterTestBase.java | 2 +- .../failover/AsynchronousFailoverTest.java | 2 +- .../failover/BackupSyncJournalTest.java | 2 +- .../cluster/failover/FailBackAutoTest.java | 2 +- .../cluster/failover/FailBackManualTest.java | 2 +- .../failover/FailoverListenerTest.java | 2 +- .../failover/FailoverOnFlowControlTest.java | 2 +- .../cluster/failover/FailoverTest.java | 26 +++++++++---------- .../failover/LiveToLiveFailoverTest.java | 4 +-- ...tipleLivesMultipleBackupsFailoverTest.java | 4 +-- .../MultipleServerFailoverTestBase.java | 4 +-- .../cluster/failover/NettyFailoverTest.java | 2 +- .../cluster/failover/PagingFailoverTest.java | 4 +-- ...SingleLiveMultipleBackupsFailoverTest.java | 2 +- .../MultiThreadRandomReattachTestBase.java | 2 +- .../NettyMultiThreadRandomReattachTest.java | 2 +- .../cluster/reattach/OrderReattachTest.java | 2 +- .../cluster/reattach/RandomReattachTest.java | 2 +- .../cluster/reattach/ReattachTest.java | 20 +++++++------- .../cluster/restart/ClusterRestartTest.java | 4 +-- .../PagingWithFailoverAndCountersTest.java | 4 +-- 27 files changed, 58 insertions(+), 58 deletions(-) diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java index 97f5e21492..e658a5372e 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java @@ -350,7 +350,7 @@ public class BMFailoverTest extends FailoverTestBase { } private void createSessionFactory() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(15); sf = createSessionFactoryAndWaitForTopology(locator, 2); } diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/ClusteredBridgeTestBase.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/ClusteredBridgeTestBase.java index fa66cf288d..e19704bf8a 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/ClusteredBridgeTestBase.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/ClusteredBridgeTestBase.java @@ -171,7 +171,7 @@ public abstract class ClusteredBridgeTestBase extends ActiveMQTestBase { backupNode.start(); waitForRemoteBackupSynchronization(backupNode.getActiveMQServer()); - locator = ActiveMQClient.createServerLocatorWithHA(liveConnector).setReconnectAttempts(-1); + locator = ActiveMQClient.createServerLocatorWithHA(liveConnector).setReconnectAttempts(15); sessionFactory = locator.createSessionFactory(); } @@ -191,7 +191,7 @@ public abstract class ClusteredBridgeTestBase extends ActiveMQTestBase { @Override public ConnectionFactory createConnectionFactory() throws Exception { ActiveMQConnectionFactory cf = ActiveMQJMSClient.createConnectionFactoryWithHA(JMSFactoryType.XA_CF, liveConnector); - cf.getServerLocator().setReconnectAttempts(-1); + cf.getServerLocator().setReconnectAttempts(15); return cf; } }; diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/ra/MDBMultipleHandlersServerDisconnectTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/ra/MDBMultipleHandlersServerDisconnectTest.java index bc613f6bd5..e645f8ee57 100644 --- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/ra/MDBMultipleHandlersServerDisconnectTest.java +++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/ra/MDBMultipleHandlersServerDisconnectTest.java @@ -82,8 +82,8 @@ public class MDBMultipleHandlersServerDisconnectTest extends ActiveMQRATestBase @Before public void setUp() throws Exception { nettyLocator = createNettyNonHALocator(); - nettyLocator.setRetryInterval(10); - nettyLocator.setReconnectAttempts(-1); + nettyLocator.setRetryInterval(100); + nettyLocator.setReconnectAttempts(300); mapCounter.clear(); resourceAdapter = null; super.setUp(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java index 8f00b2a858..6b7dab9747 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ConsumerTest.java @@ -90,7 +90,7 @@ public class ConsumerTest extends ActiveMQTestBase { public void testStressConnection() throws Exception { for (int i = 0; i < 10; i++) { - ServerLocator locatorSendx = createFactory(isNetty()).setReconnectAttempts(-1); + ServerLocator locatorSendx = createFactory(isNetty()).setReconnectAttempts(15); ClientSessionFactory factoryx = locatorSendx.createSessionFactory(); factoryx.close(); locatorSendx.close(); @@ -451,7 +451,7 @@ public class ConsumerTest extends ActiveMQTestBase { @Override public void onMessage(final ClientMessage msg) { try { - ServerLocator locatorSendx = createFactory(isNetty()).setReconnectAttempts(-1); + ServerLocator locatorSendx = createFactory(isNetty()).setReconnectAttempts(15); ClientSessionFactory factoryx = locatorSendx.createSessionFactory(); ClientSession sessionSend = factoryx.createSession(true, true); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java index 0304174304..3621897fc1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java @@ -105,7 +105,7 @@ public class ServerLocatorConnectTest extends ActiveMQTestBase { @Test public void testMultipleConnectorSingleServerConnectReconnect() throws Exception { ServerLocatorInternal locator = (ServerLocatorInternal) ActiveMQClient.createServerLocatorWithoutHA(createTransportConfiguration(isNetty(), false, generateParams(0, isNetty())), createTransportConfiguration(isNetty(), false, generateParams(1, isNetty())), createTransportConfiguration(isNetty(), false, generateParams(2, isNetty())), createTransportConfiguration(isNetty(), false, generateParams(3, isNetty())), createTransportConfiguration(isNetty(), false, generateParams(4, isNetty()))); - locator.setReconnectAttempts(-1); + locator.setReconnectAttempts(15); ClientSessionFactoryInternal csf = locator.connect(); assertNotNull(csf); assertEquals(csf.numConnections(), 1); @@ -131,7 +131,7 @@ public class ServerLocatorConnectTest extends ActiveMQTestBase { @Test public void testMultipleConnectorSingleServerNoConnectAttemptReconnect() throws Exception { ServerLocatorInternal locator = (ServerLocatorInternal) ActiveMQClient.createServerLocatorWithoutHA(createTransportConfiguration(isNetty(), false, generateParams(1, isNetty())), createTransportConfiguration(isNetty(), false, generateParams(2, isNetty())), createTransportConfiguration(isNetty(), false, generateParams(3, isNetty())), createTransportConfiguration(isNetty(), false, generateParams(4, isNetty())), createTransportConfiguration(isNetty(), false, generateParams(5, isNetty()))); - locator.setReconnectAttempts(-1); + locator.setReconnectAttempts(15); CountDownLatch countDownLatch = new CountDownLatch(1); Connector target = new Connector(locator, countDownLatch); Thread t = new Thread(target); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java index 86d32bd8ba..32238cc383 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/TemporaryQueueTest.java @@ -312,7 +312,7 @@ public class TemporaryQueueTest extends SingleServerTestBase { @Test public void testRecreateConsumerOverServerFailure() throws Exception { - ServerLocator serverWithReattach = createInVMNonHALocator().setReconnectAttempts(-1).setRetryInterval(1000).setConfirmationWindowSize(-1).setConnectionTTL(TemporaryQueueTest.CONNECTION_TTL).setClientFailureCheckPeriod(TemporaryQueueTest.CONNECTION_TTL / 3); + ServerLocator serverWithReattach = createInVMNonHALocator().setReconnectAttempts(30).setRetryInterval(1000).setConfirmationWindowSize(-1).setConnectionTTL(TemporaryQueueTest.CONNECTION_TTL).setClientFailureCheckPeriod(TemporaryQueueTest.CONNECTION_TTL / 3); ClientSessionFactory reattachSF = createSessionFactory(serverWithReattach); ClientSession session = reattachSF.createSession(false, false); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java index 538779ffe7..6e525f9277 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/distribution/ClusterTestBase.java @@ -1389,7 +1389,7 @@ public abstract class ClusterTestBase extends ActiveMQTestBase { TransportConfiguration serverToTC = createTransportConfiguration(netty, false, params); - locators[node] = addServerLocator(ActiveMQClient.createServerLocatorWithHA(serverToTC)).setRetryInterval(100).setRetryIntervalMultiplier(1d).setReconnectAttempts(-1).setBlockOnNonDurableSend(blocking).setBlockOnDurableSend(blocking); + locators[node] = addServerLocator(ActiveMQClient.createServerLocatorWithHA(serverToTC)).setRetryInterval(100).setRetryIntervalMultiplier(1d).setReconnectAttempts(300).setBlockOnNonDurableSend(blocking).setBlockOnDurableSend(blocking); final String identity = "TestClientConnector,live=" + node + ",backup=" + backupNode; ((ServerLocatorInternal) locators[node]).setIdentity(identity); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java index 7dc5162e3f..2953dd8eb9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/AsynchronousFailoverTest.java @@ -137,7 +137,7 @@ public class AsynchronousFailoverTest extends FailoverTestBase { try { for (int i = 0; i < numIts; i++) { AsynchronousFailoverTest.log.info("Iteration " + i); - ServerLocator locator = getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(-1).setConfirmationWindowSize(10 * 1024 * 1024); + ServerLocator locator = getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(15).setConfirmationWindowSize(10 * 1024 * 1024); sf = createSessionFactoryAndWaitForTopology(locator, 2); try { diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncJournalTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncJournalTest.java index b51ff8a33b..a63637cda5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncJournalTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/BackupSyncJournalTest.java @@ -78,7 +78,7 @@ public class BackupSyncJournalTest extends FailoverTestBase { startBackupServer = false; super.setUp(); setNumberOfMessages(defaultNMsgs); - locator = (ServerLocatorInternal) getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(-1); + locator = (ServerLocatorInternal) getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(15); sessionFactory = createSessionFactoryAndWaitForTopology(locator, 1); syncDelay = new BackupSyncDelay(backupServer, liveServer); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java index 2fa0f1004c..666a677079 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java @@ -232,7 +232,7 @@ public class FailBackAutoTest extends FailoverTestBase { private void createSessionFactory() throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true) // unnecessary? - .setReconnectAttempts(-1); + .setReconnectAttempts(15); sf = createSessionFactoryAndWaitForTopology(locator, 2); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java index 72bac9012a..9537433e8f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java @@ -50,7 +50,7 @@ public class FailBackManualTest extends FailoverTestBase { @Test public void testNoAutoFailback() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(15); ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java index 29acb6dc99..4bf60402cc 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java @@ -171,7 +171,7 @@ public class FailoverListenerTest extends FailoverTestBase { private void createSessionFactory(int members) throws Exception { locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true) // unnecessary? - .setReconnectAttempts(-1); + .setReconnectAttempts(15); sf = createSessionFactoryAndWaitForTopology(locator, members); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java index b5fdbe0c3c..f7d6d562bb 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverOnFlowControlTest.java @@ -42,7 +42,7 @@ public class FailoverOnFlowControlTest extends FailoverTestBase { @Test public void testOverflowSend() throws Exception { - ServerLocator locator = getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(-1).setProducerWindowSize(1000).setRetryInterval(123); + ServerLocator locator = getServerLocator().setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setProducerWindowSize(1000).setRetryInterval(100); final ArrayList sessionList = new ArrayList<>(); Interceptor interceptorClient = new Interceptor() { AtomicInteger count = new AtomicInteger(0); 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 2bbb9f3703..4c3c29e309 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 @@ -108,7 +108,7 @@ public class FailoverTest extends FailoverTestBase { // https://issues.jboss.org/browse/HORNETQ-685 @Test public void testTimeoutOnFailover() throws Exception { - locator.setCallTimeout(1000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(-1); + locator.setCallTimeout(1000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(100); ((InVMNodeManager) nodeManager).failoverPause = 500; @@ -173,7 +173,7 @@ public class FailoverTest extends FailoverTestBase { // https://issues.jboss.org/browse/HORNETQ-685 @Test public void testTimeoutOnFailoverConsume() throws Exception { - locator.setCallTimeout(5000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setBlockOnAcknowledge(true).setReconnectAttempts(-1).setAckBatchSize(0); + locator.setCallTimeout(5000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100).setAckBatchSize(0); ((InVMNodeManager) nodeManager).failoverPause = 5000L; @@ -327,7 +327,7 @@ public class FailoverTest extends FailoverTestBase { // https://issues.jboss.org/browse/HORNETQ-685 @Test public void testTimeoutOnFailoverTransactionCommit() throws Exception { - locator.setCallTimeout(5000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(-1); + locator.setCallTimeout(5000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(100); ((InVMNodeManager) nodeManager).failoverPause = 5000L; @@ -391,7 +391,7 @@ public class FailoverTest extends FailoverTestBase { // https://issues.jboss.org/browse/HORNETQ-685 @Test public void testTimeoutOnFailoverTransactionRollback() throws Exception { - locator.setCallTimeout(2000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(-1); + locator.setCallTimeout(2000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(100); ((InVMNodeManager) nodeManager).failoverPause = 5000L; @@ -444,7 +444,7 @@ public class FailoverTest extends FailoverTestBase { */ @Test public void testNonTransactedWithZeroConsumerWindowSize() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setReconnectAttempts(300).setRetryInterval(100); createClientSessionFactory(); @@ -708,7 +708,7 @@ public class FailoverTest extends FailoverTestBase { } protected void createSessionFactory() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100); sf = createSessionFactoryAndWaitForTopology(locator, 2); } @@ -787,7 +787,7 @@ public class FailoverTest extends FailoverTestBase { // https://jira.jboss.org/jira/browse/HORNETQ-285 @Test public void testFailoverOnInitialConnection() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(300).setRetryInterval(100); sf = createSessionFactoryAndWaitForTopology(locator, 2); @@ -1596,7 +1596,7 @@ public class FailoverTest extends FailoverTestBase { @Test public void testFailThenReceiveMoreMessagesAfterFailover2() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100); sf = createSessionFactoryAndWaitForTopology(locator, 2); @@ -1648,7 +1648,7 @@ public class FailoverTest extends FailoverTestBase { } private void doSimpleSendAfterFailover(final boolean durable, final boolean temporary) throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100); sf = createSessionFactoryAndWaitForTopology(locator, 2); @@ -1675,7 +1675,7 @@ public class FailoverTest extends FailoverTestBase { @Test public void testForceBlockingReturn() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100); createClientSessionFactory(); @@ -1727,7 +1727,7 @@ public class FailoverTest extends FailoverTestBase { @Test public void testCommitOccurredUnblockedAndResendNoDuplicates() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(-1).setBlockOnAcknowledge(true); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100).setBlockOnAcknowledge(true); sf = createSessionFactoryAndWaitForTopology(locator, 2); @@ -1858,7 +1858,7 @@ public class FailoverTest extends FailoverTestBase { @Test public void testCommitDidNotOccurUnblockedAndResend() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100); sf = createSessionFactoryAndWaitForTopology(locator, 2); @@ -2058,7 +2058,7 @@ public class FailoverTest extends FailoverTestBase { @Test public void testLiveAndBackupBackupComesBackNewFactory() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(300).setRetryInterval(100); sf = createSessionFactoryAndWaitForTopology(locator, 2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java index 1ca2497ad5..614f041c90 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java @@ -163,7 +163,7 @@ public class LiveToLiveFailoverTest extends FailoverTest { @Override protected void createSessionFactory() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100); sf = createSessionFactoryAndWaitForTopology(locator, getConnectorTransportConfiguration(true, 0), 2); @@ -217,7 +217,7 @@ public class LiveToLiveFailoverTest extends FailoverTest { @Override @Test public void testFailoverOnInitialConnection() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(300).setRetryInterval(100); sf = createSessionFactoryAndWaitForTopology(locator, 2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java index d0208183cd..30bd24c090 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleLivesMultipleBackupsFailoverTest.java @@ -73,7 +73,7 @@ public class MultipleLivesMultipleBackupsFailoverTest extends MultipleBackupsFai waitForServerToStart(servers.get(4).getServer()); - locator = getServerLocator(0).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(-1); + locator = getServerLocator(0).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(15); ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 4, servers.get(0).getServer()); ClientSession session = sendAndConsume(sf, true); @@ -84,7 +84,7 @@ public class MultipleLivesMultipleBackupsFailoverTest extends MultipleBackupsFai int liveAfter0 = waitForNewLive(10000, true, servers, 1, 2); - locator2 = getServerLocator(3).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(-1); + locator2 = getServerLocator(3).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(15); ClientSessionFactoryInternal sf2 = createSessionFactoryAndWaitForTopology(locator2, 4); ClientSession session2 = sendAndConsume(sf2, true); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java index cc1ebf6c44..8d075aa860 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/MultipleServerFailoverTestBase.java @@ -190,11 +190,11 @@ public abstract class MultipleServerFailoverTestBase extends ActiveMQTestBase { } protected ServerLocatorInternal getServerLocator(int node) throws Exception { - return (ServerLocatorInternal) addServerLocator(ActiveMQClient.createServerLocatorWithHA(getConnectorTransportConfiguration(true, node))).setRetryInterval(50).setReconnectAttempts(-1).setInitialConnectAttempts(-1); + return (ServerLocatorInternal) addServerLocator(ActiveMQClient.createServerLocatorWithHA(getConnectorTransportConfiguration(true, node))).setRetryInterval(100).setReconnectAttempts(300).setInitialConnectAttempts(300); } protected ServerLocatorInternal getBackupServerLocator(int node) throws Exception { - return (ServerLocatorInternal) addServerLocator(ActiveMQClient.createServerLocatorWithHA(getConnectorTransportConfiguration(false, node))).setRetryInterval(50).setReconnectAttempts(-1).setInitialConnectAttempts(-1); + return (ServerLocatorInternal) addServerLocator(ActiveMQClient.createServerLocatorWithHA(getConnectorTransportConfiguration(false, node))).setRetryInterval(100).setReconnectAttempts(300).setInitialConnectAttempts(300); } protected ClientSession createSession(ClientSessionFactory sf, diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java index f3801a1c1c..0c8d1161a3 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/NettyFailoverTest.java @@ -48,7 +48,7 @@ public class NettyFailoverTest extends FailoverTest { params.put(TransportConstants.HOST_PROP_NAME, "127.0.0.1"); TransportConfiguration tc = createTransportConfiguration(true, false, params); - ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithHA(tc)).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(-1); + ServerLocator locator = addServerLocator(ActiveMQClient.createServerLocatorWithHA(tc)).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(15); ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 2); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java index 6467016fdb..3e9eba45d1 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/PagingFailoverTest.java @@ -87,7 +87,7 @@ public class PagingFailoverTest extends FailoverTestBase { } public void internalTestPage(final boolean transacted, final boolean failBeforeConsume) throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(15); sf = createSessionFactoryAndWaitForTopology(locator, 2); session = addClientSession(sf.createSession(!transacted, !transacted, 0)); @@ -165,7 +165,7 @@ public class PagingFailoverTest extends FailoverTestBase { @Test public void testExpireMessage() throws Exception { - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(15); ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 2); session = sf.createSession(true, true, 0); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java index 3cf06d2375..a3174d7cc9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/SingleLiveMultipleBackupsFailoverTest.java @@ -80,7 +80,7 @@ public class SingleLiveMultipleBackupsFailoverTest extends MultipleBackupsFailov // for logging and debugging topology.setOwner("testMultipleFailovers"); - locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(-1); + locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true).setReconnectAttempts(15); ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 2); int backupNode; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java index 83e516cb3f..fffdf2e963 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/MultiThreadRandomReattachTestBase.java @@ -1129,7 +1129,7 @@ public abstract class MultiThreadRandomReattachTestBase extends MultiThreadReatt */ @Override protected ServerLocator createLocator() throws Exception { - ServerLocator locator = createInVMNonHALocator().setReconnectAttempts(-1).setConfirmationWindowSize(1024 * 1024); + ServerLocator locator = createInVMNonHALocator().setReconnectAttempts(15).setConfirmationWindowSize(1024 * 1024); return locator; } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java index 0465567b41..984b69ef29 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/NettyMultiThreadRandomReattachTest.java @@ -31,7 +31,7 @@ public class NettyMultiThreadRandomReattachTest extends MultiThreadRandomReattac @Override protected ServerLocator createLocator() throws Exception { - return createNettyNonHALocator().setReconnectAttempts(-1).setConfirmationWindowSize(1024 * 1024).setAckBatchSize(0); + return createNettyNonHALocator().setReconnectAttempts(15).setConfirmationWindowSize(1024 * 1024).setAckBatchSize(0); } } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java index f174f3ed75..dcb42390e9 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/OrderReattachTest.java @@ -65,7 +65,7 @@ public class OrderReattachTest extends ActiveMQTestBase { server = createServer(false, isNetty); server.start(); - ServerLocator locator = createFactory(isNetty).setReconnectAttempts(-1).setConfirmationWindowSize(1024 * 1024).setBlockOnNonDurableSend(false).setBlockOnAcknowledge(false); + ServerLocator locator = createFactory(isNetty).setReconnectAttempts(15).setConfirmationWindowSize(1024 * 1024).setBlockOnNonDurableSend(false).setBlockOnAcknowledge(false); ClientSessionFactory sf = createSessionFactory(locator); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java index 4d44334d5a..a516ebf242 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/RandomReattachTest.java @@ -205,7 +205,7 @@ public class RandomReattachTest extends ActiveMQTestBase { for (int its = 0; its < numIts; its++) { RandomReattachTest.log.info("####" + getName() + " iteration #" + its); start(); - ServerLocator locator = createInVMNonHALocator().setReconnectAttempts(-1).setConfirmationWindowSize(1024 * 1024); + ServerLocator locator = createInVMNonHALocator().setReconnectAttempts(15).setConfirmationWindowSize(1024 * 1024); ClientSessionFactory sf = createSessionFactory(locator); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java index 64596d1e52..d8ae31c881 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/reattach/ReattachTest.java @@ -192,7 +192,7 @@ public class ReattachTest extends ActiveMQTestBase { final double retryMultiplier = 1d; - final int reconnectAttempts = -1; + final int reconnectAttempts = 60; locator.setRetryInterval(retryInterval).setRetryIntervalMultiplier(retryMultiplier).setReconnectAttempts(reconnectAttempts).setConfirmationWindowSize(1024 * 1024); @@ -267,7 +267,7 @@ public class ReattachTest extends ActiveMQTestBase { final double retryMultiplier = 1d; - final int reconnectAttempts = -1; + final int reconnectAttempts = 60; final long asyncFailDelay = 2000; @@ -447,11 +447,11 @@ public class ReattachTest extends ActiveMQTestBase { try { - final long retryInterval = 50; + final long retryInterval = 100; final double retryMultiplier = 1d; - final int reconnectAttempts = -1; + final int reconnectAttempts = 300; locator.setRetryInterval(retryInterval).setRetryIntervalMultiplier(retryMultiplier).setReconnectAttempts(reconnectAttempts).setConfirmationWindowSize(1024 * 1024); @@ -542,7 +542,7 @@ public class ReattachTest extends ActiveMQTestBase { final double retryMultiplier = 1d; - final int reconnectAttempts = -1; + final int reconnectAttempts = 60; locator.setRetryInterval(retryInterval).setRetryIntervalMultiplier(retryMultiplier).setReconnectAttempts(reconnectAttempts).setConfirmationWindowSize(1024 * 1024); @@ -621,11 +621,11 @@ public class ReattachTest extends ActiveMQTestBase { @Test public void testCreateQueue() throws Exception { - final long retryInterval = 50; + final long retryInterval = 100; final double retryMultiplier = 1d; - final int reconnectAttempts = -1; + final int reconnectAttempts = 300; locator.setRetryInterval(retryInterval).setRetryIntervalMultiplier(retryMultiplier).setReconnectAttempts(reconnectAttempts).setConfirmationWindowSize(1024 * 1024); @@ -748,7 +748,7 @@ public class ReattachTest extends ActiveMQTestBase { final double retryMultiplier = 1d; - final int reconnectAttempts = -1; + final int reconnectAttempts = 60; locator.setRetryInterval(retryInterval).setRetryIntervalMultiplier(retryMultiplier).setReconnectAttempts(reconnectAttempts).setConfirmationWindowSize(1024 * 1024); @@ -827,7 +827,7 @@ public class ReattachTest extends ActiveMQTestBase { final double retryMultiplier = 2d; - final int reconnectAttempts = -1; + final int reconnectAttempts = 60; locator.setRetryInterval(retryInterval).setRetryIntervalMultiplier(retryMultiplier).setReconnectAttempts(reconnectAttempts).setConfirmationWindowSize(1024 * 1024); @@ -894,7 +894,7 @@ public class ReattachTest extends ActiveMQTestBase { final double retryMultiplier = 2d; - final int reconnectAttempts = -1; + final int reconnectAttempts = 60; final long maxRetryInterval = 1000; diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java index 3a0d92af13..ccbe267afa 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/restart/ClusterRestartTest.java @@ -43,7 +43,7 @@ public class ClusterRestartTest extends ClusterTestBase { System.out.println("server 0 = " + getServer(0).getNodeID()); System.out.println("server 1 = " + getServer(1).getNodeID()); - setupSessionFactory(0, isNetty(), -1); + setupSessionFactory(0, isNetty(), 15); setupSessionFactory(1, isNetty()); // create some dummy queues to ensure that the test queue has a high numbered binding @@ -106,7 +106,7 @@ public class ClusterRestartTest extends ClusterTestBase { System.out.println("server 0 = " + getServer(0).getNodeID()); System.out.println("server 1 = " + getServer(1).getNodeID()); - setupSessionFactory(0, isNetty(), -1); + setupSessionFactory(0, isNetty(), 15); setupSessionFactory(1, isNetty()); // create some dummy queues to ensure that the test queue has a high numbered binding diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java index 44b1558153..615c4cb204 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/paging/PagingWithFailoverAndCountersTest.java @@ -279,7 +279,7 @@ public class PagingWithFailoverAndCountersTest extends ActiveMQTestBase { public void testValidateDeliveryAndCounters() throws Exception { startLive(); - ServerLocator locator = SpawnedServerSupport.createLocator(PORT1).setInitialConnectAttempts(-1).setReconnectAttempts(-1).setRetryInterval(100); + ServerLocator locator = SpawnedServerSupport.createLocator(PORT1).setInitialConnectAttempts(300).setReconnectAttempts(300).setRetryInterval(100); ClientSessionFactory factory = locator.createSessionFactory(); @@ -348,7 +348,7 @@ public class PagingWithFailoverAndCountersTest extends ActiveMQTestBase { assertTrue(messageCount >= 0); - locator = SpawnedServerSupport.createLocator(PORT1).setInitialConnectAttempts(100).setReconnectAttempts(-1).setRetryInterval(100); + locator = SpawnedServerSupport.createLocator(PORT1).setInitialConnectAttempts(100).setReconnectAttempts(300).setRetryInterval(100); factory = locator.createSessionFactory();