From 065f9945eb0f86cdb6e6c1d87e997acb0bb64e97 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 7 Jun 2016 12:51:23 -0400 Subject: [PATCH 1/3] Fixing test faliure --- .../artemis/tests/integration/karaf/ArtemisFeatureTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java index 75a12a845e..134dd9a702 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/karaf/ArtemisFeatureTest.java @@ -16,13 +16,13 @@ */ package org.apache.activemq.artemis.tests.integration.karaf; -import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.karaf.jaas.boot.principal.RolePrincipal; import org.apache.karaf.jaas.boot.principal.UserPrincipal; import org.apache.karaf.shell.api.console.Session; import org.apache.karaf.shell.api.console.SessionFactory; import org.apache.log4j.Logger; import org.apache.qpid.jms.JmsConnectionFactory; +import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.ops4j.pax.exam.Configuration; @@ -66,7 +66,7 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDist import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel; @RunWith(PaxExam.class) -public class ArtemisFeatureTest extends ActiveMQTestBase { +public class ArtemisFeatureTest extends Assert { private static Logger LOG = Logger.getLogger(ArtemisFeatureTest.class.getName()); From f0f431aceabe9f228fb50968ae1969287e5fff8e Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 7 Jun 2016 16:10:06 -0400 Subject: [PATCH 2/3] Adding more time on checkWeakReferences This will fix a few intermittent failures --- .../apache/activemq/artemis/tests/util/ActiveMQTestBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 064091d395..3e4d4c0a2d 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 @@ -627,7 +627,7 @@ public abstract class ActiveMQTestBase extends Assert { break; } } - } while (i++ <= 50 && hasValue); + } while (i++ <= 200 && hasValue); for (WeakReference ref : references) { Assert.assertNull(ref.get()); From fcaef51963f6d7363f9ed7f45d3236c060e5ce55 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Tue, 7 Jun 2016 16:24:34 -0400 Subject: [PATCH 3/3] test fix --- .../tests/integration/cluster/failover/FailoverTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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 229136acd0..ea9cb8ed61 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 @@ -410,8 +410,13 @@ public class FailoverTest extends FailoverTestBase { session.rollback(xid); } catch (XAException e) { - //there is still an edge condition that we must deal with - session.rollback(xid); + try { + //there is still an edge condition that we must deal with + session.rollback(xid); + } + catch (Exception ignored) { + log.trace(ignored.getMessage(), ignored); + } } ClientConsumer consumer = session.createConsumer(FailoverTestBase.ADDRESS);