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 2016/04/01 18:38:26 UTC

[2/2] activemq-artemis git commit: avoiding FailoverTransactionTest hanging in case of failure

avoiding FailoverTransactionTest hanging in case of failure


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/ca1e352e
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/ca1e352e
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/ca1e352e

Branch: refs/heads/refactor-openwire
Commit: ca1e352e3f5e6bc9a30684a6be35cd38f664e646
Parents: 2b7acf8
Author: Clebert Suconic <cl...@apache.org>
Authored: Fri Apr 1 12:38:03 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Fri Apr 1 12:38:05 2016 -0400

----------------------------------------------------------------------
 .../transport/failover/FailoverTransactionTest.java     | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/ca1e352e/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java
index 45f8b30..14f9321 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java
@@ -635,7 +635,11 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest {
 
          // will be stopped by the plugin
          brokerStopLatch.await(60, TimeUnit.SECONDS);
-         t.join();
+         t.join(30000);
+         if (t.isAlive()) {
+            t.interrupt();
+            Assert.fail("Thread " + t.getName() + " is still alive");
+         }
          broker = createBroker();
          broker.start();
          doByteman.set(false);
@@ -1058,8 +1062,10 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest {
             new Thread() {
                public void run() {
                   try {
-                     broker.stop();
-                     broker = null;
+                     if (broker != null) {
+                        broker.stop();
+                        broker = null;
+                     }
                      LOG.info("broker stopped.");
                   }
                   catch (Exception e) {