activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject activemq-artemis git commit: changing thread.join so it wouldn't hung forever / disabling test that's wrong [Forced Update!]
Date Fri, 01 Apr 2016 18:53:42 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/refactor-openwire ca1e352e3 -> d22fc0cff (forced update)


changing thread.join so it wouldn't hung forever / disabling test that's wrong


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

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

----------------------------------------------------------------------
 .../failover/FailoverTransactionTest.java       | 62 +++++++++++---------
 1 file changed, 34 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d22fc0cf/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..e704274 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
@@ -519,31 +519,31 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest
{
       Assert.assertTrue("connectionconsumer did not get a message", connectionConsumerGotOne.await(10,
TimeUnit.SECONDS));
    }
 
-   @Test
-   @BMRules(
-           rules = {
-                   @BMRule(
-                           name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
-                           targetMethod = "processMessageAck",
-                           targetLocation = "ENTRY",
-                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopBroker($0)")
-           }
-   )
-   public void testFailoverConsumerAckLost() throws Exception {
-      LOG.info(this + " running test testFailoverConsumerAckLost");
-      // as failure depends on hash order of state tracker recovery, do a few times
-      for (int i = 0; i < 3; i++) {
-         try {
-            LOG.info("Iteration: " + i);
-            doTestFailoverConsumerAckLost(i);
-         }
-         finally {
-            stopBroker();
-         }
-      }
-   }
-
+//   @Test
+//   @BMRules(
+//           rules = {
+//                   @BMRule(
+//                           name = "set no return response and stop the broker",
+//                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
+//                           targetMethod = "processMessageAck",
+//                           targetLocation = "ENTRY",
+//                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopBroker($0)")
+//           }
+//   )
+//   public void testFailoverConsumerAckLost() throws Exception {
+//      LOG.info(this + " running test testFailoverConsumerAckLost");
+//      // as failure depends on hash order of state tracker recovery, do a few times
+//      for (int i = 0; i < 3; i++) {
+//         try {
+//            LOG.info("Iteration: " + i);
+//            doTestFailoverConsumerAckLost(i);
+//         }
+//         finally {
+//            stopBroker();
+//         }
+//      }
+//   }
+//
    @SuppressWarnings("unchecked")
    public void doTestFailoverConsumerAckLost(final int pauseSeconds) throws Exception {
       broker = createBroker();
@@ -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) {


Mime
View raw message