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/09/06 18:25:07 UTC
[activemq-artemis] branch master updated: NO-JIRA Fixing
intermittent failure on BasicXaTest
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 93dcd27 NO-JIRA Fixing intermittent failure on BasicXaTest
new 48027bd This closes #2824
93dcd27 is described below
commit 93dcd27b394d3db3d93f53af467a4083188337f2
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Fri Sep 6 10:28:12 2019 -0400
NO-JIRA Fixing intermittent failure on BasicXaTest
It would fail on cannot destroy queue
as the failure could be asynchronous, introducing a quick race, which is acceptable
you just need to make sure the async operation will finish before removing the queue.
Fix is to introduce a Wait.assertEquals call.
---
.../apache/activemq/artemis/tests/integration/xa/BasicXaTest.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java
index d0d8ce3..3f57aea 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/xa/BasicXaTest.java
@@ -40,12 +40,14 @@ import org.apache.activemq.artemis.core.config.StoreConfiguration;
import org.apache.activemq.artemis.core.persistence.StorageManager;
import org.apache.activemq.artemis.core.server.ActiveMQServer;
import org.apache.activemq.artemis.api.core.RoutingType;
+import org.apache.activemq.artemis.core.server.Queue;
import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
import org.apache.activemq.artemis.core.transaction.impl.XidImpl;
import org.apache.activemq.artemis.ra.ActiveMQRAXAResource;
import org.apache.activemq.artemis.tests.integration.IntegrationTestLogger;
import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
import org.apache.activemq.artemis.utils.UUIDGenerator;
+import org.apache.activemq.artemis.utils.Wait;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -233,8 +235,13 @@ public class BasicXaTest extends ActiveMQTestBase {
clientSession.end(xid, XAResource.TMSUCCESS);
clientSession.prepare(xid);
+ Queue queueAtestQ = messagingService.locateQueue(atestq);
+ Assert.assertNotNull(queueAtestQ);
+
clientSession.getSessionFactory().getConnection().destroy();
+ Wait.assertEquals(0, queueAtestQ::getConsumerCount);
+
messagingService.destroyQueue(atestq);
messagingService.stop();