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/07/23 20:13:12 UTC
[activemq-artemis] branch master updated: NO-JIRA Fixing
FailoverTest::testTimeoutOnFailoverConsumer
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 c9f2833 NO-JIRA Fixing FailoverTest::testTimeoutOnFailoverConsumer
c9f2833 is described below
commit c9f283386359ce5df81397fe857277c18874a468
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Tue Jul 23 16:11:55 2019 -0400
NO-JIRA Fixing FailoverTest::testTimeoutOnFailoverConsumer
this test was basically broken, it was silently failing as it was ignoring results and taking a long time to finish.
As this test is multiplied along many options (Netty, Replicated, JDBC) this was taking considerable extra time
on the testsuite.
---
.../tests/integration/cluster/failover/FailoverTest.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
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 3d35027..fa5cd04 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
@@ -176,12 +176,12 @@ public class FailoverTest extends FailoverTestBase {
}
// https://issues.jboss.org/browse/HORNETQ-685
- @Test(timeout = 120000)
+ @Test
public void testTimeoutOnFailoverConsume() throws Exception {
- locator.setCallTimeout(5000).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(100).setAckBatchSize(0);
+ locator.setCallTimeout(100).setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setAckBatchSize(0).setBlockOnAcknowledge(true).setReconnectAttempts(300).setRetryInterval(10).setAckBatchSize(0);
if (nodeManager instanceof InVMNodeManager) {
- ((InVMNodeManager) nodeManager).failoverPause = 5000L;
+ ((InVMNodeManager) nodeManager).failoverPause = 500L;
}
ClientSessionFactoryInternal sf1 = (ClientSessionFactoryInternal) createSessionFactory(locator);
@@ -210,6 +210,8 @@ public class FailoverTest extends FailoverTestBase {
@Override
public void onMessage(ClientMessage message) {
+
+ System.out.println("Received " + message);
Integer counter = message.getIntProperty("counter");
received.put(counter, message);
try {
@@ -224,7 +226,7 @@ public class FailoverTest extends FailoverTestBase {
if (counter.equals(10)) {
latch.countDown();
}
- if (received.size() == 500) {
+ if (received.size() == 100) {
endLatch.countDown();
}
}
@@ -233,8 +235,7 @@ public class FailoverTest extends FailoverTestBase {
latch.await(10, TimeUnit.SECONDS);
log.info("crashing session");
crash(session);
- endLatch.await(60, TimeUnit.SECONDS);
- Assert.assertTrue("received only " + received.size(), received.size() == 500);
+ Assert.assertTrue(endLatch.await(60, TimeUnit.SECONDS));
session.close();
}