From commits-return-50852-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Thu Mar 22 20:47:48 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 72FC9180676 for ; Thu, 22 Mar 2018 20:47:47 +0100 (CET) Received: (qmail 46207 invoked by uid 500); 22 Mar 2018 19:47:46 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 46194 invoked by uid 99); 22 Mar 2018 19:47:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2018 19:47:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BB444F6756; Thu, 22 Mar 2018 19:47:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: clebertsuconic@apache.org To: commits@activemq.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: activemq-artemis git commit: ARTEMIS-1753 Fixing intermittent failure on OldAddressSpaceTest Date: Thu, 22 Mar 2018 19:47:45 +0000 (UTC) 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 Authored: Thu Mar 22 14:58:46 2018 -0400 Committer: Clebert Suconic 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));