activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martyntay...@apache.org
Subject [5/8] activemq-artemis git commit: Improving test.
Date Fri, 11 Sep 2015 14:06:05 GMT
Improving test.

There's a race here that only happens on Virtual Machines (VMWare.. etc)


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

Branch: refs/heads/master
Commit: d5a01287a5c54c3a6f1c1e8b22f7a4885cb83163
Parents: d3ea9ac
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Thu Sep 10 17:50:07 2015 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Fri Sep 11 09:06:38 2015 -0400

----------------------------------------------------------------------
 .../activemq/artemis/tests/integration/proton/ProtonTest.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/d5a01287/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/proton/ProtonTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/proton/ProtonTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/proton/ProtonTest.java
index e779c14..7663f69 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/proton/ProtonTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/proton/ProtonTest.java
@@ -131,6 +131,7 @@ public class ProtonTest extends ActiveMQTestBase {
    @After
    public void tearDown() throws Exception {
       try {
+         Thread.sleep(250);
          if (connection != null) {
             connection.close();
          }
@@ -257,6 +258,10 @@ public class ProtonTest extends ActiveMQTestBase {
 
       cons.close();
 
+      for (int i = 0; i < 100 && serverQueue.getConsumerCount() != 0; i++) {
+         Thread.sleep(500);
+      }
+
       assertEquals(0, serverQueue.getConsumerCount());
 
       session.close();
@@ -330,7 +335,7 @@ public class ProtonTest extends ActiveMQTestBase {
       connection = createConnection();
       session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
       MessageConsumer consumer = session.createConsumer(queue);
-      Thread.sleep(1000);
+      Thread.sleep(100);
       consumer.close();
       connection.close();
       Assert.assertEquals(numMessages, getMessageCount(q));


Mime
View raw message