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: ARTEMIS-1753 Fixing intermittent failure on OldAddressSpaceTest
Date Thu, 22 Mar 2018 19:47:45 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master e26c05161 -> 37657f22f


ARTEMIS-1753 Fixing intermittent failure on OldAddressSpaceTest


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

Branch: refs/heads/master
Commit: 37657f22fa5ae1ff43b752c5823e8097e5db9e6c
Parents: e26c051
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Thu Mar 22 14:58:46 2018 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Thu Mar 22 15:46:27 2018 -0400

----------------------------------------------------------------------
 .../main/resources/oldAddressSpace/artemisServer.groovy   |  2 +-
 .../main/resources/oldAddressSpace/receiveMessages.groovy |  4 +++-
 .../resources/oldAddressSpace/sendMessagesAddress.groovy  |  2 +-
 .../artemis/tests/compatibility/OldAddressSpaceTest.java  | 10 ++++++++--
 4 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/37657f22/tests/compatibility-tests/src/main/resources/oldAddressSpace/artemisServer.groovy
----------------------------------------------------------------------
diff --git a/tests/compatibility-tests/src/main/resources/oldAddressSpace/artemisServer.groovy
b/tests/compatibility-tests/src/main/resources/oldAddressSpace/artemisServer.groovy
index 6ffa086..85f6619 100644
--- a/tests/compatibility-tests/src/main/resources/oldAddressSpace/artemisServer.groovy
+++ b/tests/compatibility-tests/src/main/resources/oldAddressSpace/artemisServer.groovy
@@ -1,4 +1,4 @@
-package servers
+package oldAddressSpace
 
 import org.apache.activemq.artemis.api.core.RoutingType
 import org.apache.activemq.artemis.api.core.SimpleString

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/37657f22/tests/compatibility-tests/src/main/resources/oldAddressSpace/receiveMessages.groovy
----------------------------------------------------------------------
diff --git a/tests/compatibility-tests/src/main/resources/oldAddressSpace/receiveMessages.groovy
b/tests/compatibility-tests/src/main/resources/oldAddressSpace/receiveMessages.groovy
index 149a6b7..1594cc8 100644
--- a/tests/compatibility-tests/src/main/resources/oldAddressSpace/receiveMessages.groovy
+++ b/tests/compatibility-tests/src/main/resources/oldAddressSpace/receiveMessages.groovy
@@ -1,4 +1,4 @@
-package meshTest
+package oldAddressSpace
 
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
 import org.apache.activemq.artemis.tests.compatibility.GroovyRun
@@ -46,6 +46,8 @@ System.out.println("Receiving...");
 MessageConsumer topicConsumer = session.createDurableSubscriber(topic, "myDurableSub")
 MessageConsumer queueConsumer = session.createConsumer(queue)
 
+subscriptionCreated.countDown();
+
 connection.start()
 for (int i = 0; i < 500; i++) {
     BytesMessage bytesMessage = (BytesMessage) queueConsumer.receive(5000);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/37657f22/tests/compatibility-tests/src/main/resources/oldAddressSpace/sendMessagesAddress.groovy
----------------------------------------------------------------------
diff --git a/tests/compatibility-tests/src/main/resources/oldAddressSpace/sendMessagesAddress.groovy
b/tests/compatibility-tests/src/main/resources/oldAddressSpace/sendMessagesAddress.groovy
index afd30b1..9ade9bb 100644
--- a/tests/compatibility-tests/src/main/resources/oldAddressSpace/sendMessagesAddress.groovy
+++ b/tests/compatibility-tests/src/main/resources/oldAddressSpace/sendMessagesAddress.groovy
@@ -1,4 +1,4 @@
-package meshTest
+package oldAddressSpace
 
 import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/37657f22/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/OldAddressSpaceTest.java
----------------------------------------------------------------------
diff --git a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/OldAddressSpaceTest.java
b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/OldAddressSpaceTest.java
index 4b439a8..a0803b8 100644
--- a/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/OldAddressSpaceTest.java
+++ b/tests/compatibility-tests/src/test/java/org/apache/activemq/artemis/tests/compatibility/OldAddressSpaceTest.java
@@ -63,10 +63,12 @@ public class OldAddressSpaceTest extends VersionedBaseTest {
    public void testClientSenderServerAddressSettings() throws Throwable {
       evaluate(serverClassloader, "oldAddressSpace/artemisServer.groovy", serverFolder.getRoot().getAbsolutePath(),
server);
 
+      CountDownLatch subscriptionCreated = new CountDownLatch(1);
       CountDownLatch receiverLatch = new CountDownLatch(1);
       CountDownLatch senderLatch = new CountDownLatch(1);
 
       setVariable(receiverClassloader, "latch", receiverLatch);
+      setVariable(receiverClassloader, "subscriptionCreated", subscriptionCreated);
 
       AtomicInteger errors = new AtomicInteger(0);
       Thread t1 = new Thread() {
@@ -75,12 +77,15 @@ public class OldAddressSpaceTest extends VersionedBaseTest {
             try {
                evaluate(receiverClassloader, "oldAddressSpace/receiveMessages.groovy", receiver);
             } catch (Throwable e) {
+               e.printStackTrace();
                errors.incrementAndGet();
             }
          }
       };
       t1.start();
 
+      Assert.assertTrue(subscriptionCreated.await(10, TimeUnit.SECONDS));
+
       setVariable(senderClassloader, "senderLatch", senderLatch);
       Thread t2 = new Thread() {
          @Override
@@ -88,6 +93,7 @@ public class OldAddressSpaceTest extends VersionedBaseTest {
             try {
                evaluate(senderClassloader, "oldAddressSpace/sendMessagesAddress.groovy",
sender);
             } catch (Throwable e) {
+               e.printStackTrace();
                errors.incrementAndGet();
             }
          }
@@ -96,8 +102,8 @@ public class OldAddressSpaceTest extends VersionedBaseTest {
 
 
       try {
-         Assert.assertTrue("Sender is blocking by mistake", senderLatch.await(100, TimeUnit.SECONDS));
-         Assert.assertTrue("Receiver did not receive messages", receiverLatch.await(100,
TimeUnit.SECONDS));
+         Assert.assertTrue("Sender is blocking by mistake", senderLatch.await(10, TimeUnit.SECONDS));
+         Assert.assertTrue("Receiver did not receive messages", receiverLatch.await(10, TimeUnit.SECONDS));
       } finally {
 
          t1.join(TimeUnit.SECONDS.toMillis(1));


Mime
View raw message