From db65c2e02714a542e83690b36aca312b962b8bcf Mon Sep 17 00:00:00 2001 From: gtully Date: Mon, 8 Dec 2014 13:54:46 +0000 Subject: [PATCH] fix JMSClientNioTest close timeout leaving broker hanging about --- .../activemq/transport/amqp/AmqpTestSupport.java | 11 ++++++----- .../activemq/transport/amqp/JMSClientTestSupport.java | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java index 2f2f5aff2e..23a964d654 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/AmqpTestSupport.java @@ -217,12 +217,13 @@ public class AmqpTestSupport { LOG.debug("tearDown started."); future.get(60, TimeUnit.SECONDS); } catch (TimeoutException e) { - throw new Exception("startBroker timed out"); - } - executor.shutdownNow(); + throw new Exception("stopBroker timed out"); + } finally { + executor.shutdownNow(); - if (killHungThreads("tearDown")) { - LOG.warn("HUNG THREADS in setUp"); + if (killHungThreads("tearDown")) { + LOG.warn("HUNG THREADS in tearDown"); + } } } diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java index b374ee82b6..f53eee3529 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java @@ -45,10 +45,10 @@ public class JMSClientTestSupport extends AmqpTestSupport { future.get(60, TimeUnit.SECONDS); } catch (TimeoutException e) { throw new Exception("CloseConnection timed out"); + } finally { + executor.shutdownNow(); + super.tearDown(); } - executor.shutdownNow(); - - super.tearDown(); } public class CloseConnectionTask implements Callable {