[activemq] branch master updated: AMQ-5035 - fix intermittent failure due to async close

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[activemq] branch master updated: AMQ-5035 - fix intermittent failure due to async close

gtully-2
This is an automated email from the ASF dual-hosted git repository.

gtully pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq.git


The following commit(s) were added to refs/heads/master by this push:
     new 4d6409b  AMQ-5035 - fix intermittent failure due to async close
4d6409b is described below

commit 4d6409b3b82c1c6ab534cf0da253971e008bc13f
Author: gtully <[hidden email]>
AuthorDate: Mon Dec 2 11:42:08 2019 +0000

    AMQ-5035 - fix intermittent failure due to async close
---
 .../src/test/java/org/apache/activemq/bugs/AMQ5035Test.java       | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5035Test.java b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5035Test.java
index f552b15..b729990 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5035Test.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/bugs/AMQ5035Test.java
@@ -17,8 +17,10 @@
 package org.apache.activemq.bugs;
 
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import javax.jms.Connection;
+import javax.jms.JMSException;
 import javax.jms.MessageConsumer;
 import javax.jms.Session;
 import javax.jms.Topic;
@@ -72,7 +74,11 @@ public class AMQ5035Test {
         consumer.close();
 
         BrokerViewMBean brokerView = getBrokerView(DURABLE_SUB_NAME);
-        brokerView.destroyDurableSubscriber(CLIENT_ID, DURABLE_SUB_NAME);
+        try {
+            brokerView.destroyDurableSubscriber(CLIENT_ID, DURABLE_SUB_NAME);
+        } catch (JMSException okAsCloseIsAsync) {
+            assertTrue("inactive reason", okAsCloseIsAsync.getMessage().contains("in use"));
+        }
     }
 
     private BrokerViewMBean getBrokerView(String testDurable) throws MalformedObjectNameException {