From 35f30102a6d2083bd640f86f30abffc536863458 Mon Sep 17 00:00:00 2001 From: gtully Date: Wed, 3 May 2017 12:31:09 +0100 Subject: [PATCH] [AMQ-2100] fix for intermittent ci failure --- .../src/test/java/org/apache/activemq/JMSConsumerTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java index 8785acbb7c..5ccf1bd515 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java @@ -27,6 +27,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import javax.jms.BytesMessage; +import javax.jms.IllegalStateException; import javax.jms.JMSException; import javax.jms.DeliveryMode; import javax.jms.Message; @@ -161,7 +162,9 @@ public class JMSConsumerTest extends JmsTestSupport { if (count % 200 == 0) { // ensure there are some outstanding messages // ack every 200 - message.acknowledge(); + try { + message.acknowledge(); + } catch (IllegalStateException okForAck) {} } } catch (Exception e) { LOG.error("Exception on close or ack:", e);