NO-JIRA: Cleanup on Smoke test

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

Branch: refs/heads/master
Commit: 029132c1f41afb7f3c823b19ff98d6bb224208ea
Parents: f573824
Author: Clebert Suconic <[email protected]>
Authored: Thu Apr 6 16:44:40 2017 -0400
Committer: Justin Bertram <[email protected]>
Committed: Thu Apr 6 19:56:30 2017 -0500

----------------------------------------------------------------------
 .../replicationflow/ReplicationFlowControlTest.java   | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/029132c1/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/ReplicationFlowControlTest.java
----------------------------------------------------------------------
diff --git 
a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/ReplicationFlowControlTest.java
 
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/ReplicationFlowControlTest.java
index 4433775..85dcd99 100644
--- 
a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/ReplicationFlowControlTest.java
+++ 
b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/replicationflow/ReplicationFlowControlTest.java
@@ -147,8 +147,17 @@ public class ReplicationFlowControlTest extends 
SmokeTestBase {
          session.commit();
 
          System.out.println("Awaiting all consumers to finish");
-         while (!latch.await(5, TimeUnit.SECONDS)) {
-            System.out.println("Missing " + latch.getCount() + ", 
totalConsumed = " + totalConsumed);
+         while (!latch.await(10, TimeUnit.SECONDS)) {
+            fail("couldn't receive all messages");
+         }
+
+         running.set(false);
+
+         for (Consumer consumer: consumers) {
+            consumer.join(10000);
+            if (consumer.isAlive()) {
+               consumer.interrupt();
+            }
          }
 
       } finally {
@@ -257,6 +266,7 @@ public class ReplicationFlowControlTest extends 
SmokeTestBase {
             }
          } finally {
             try {
+               session.commit();
                connection.close();
             } catch (Throwable ignored) {
             }

Reply via email to