From commits-return-51092-archive-asf-public=cust-asf.ponee.io@activemq.apache.org Tue Apr 17 18:32:04 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 2D484180789 for ; Tue, 17 Apr 2018 18:32:04 +0200 (CEST) Received: (qmail 40705 invoked by uid 500); 17 Apr 2018 16:32:03 -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 40696 invoked by uid 99); 17 Apr 2018 16:32:03 -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; Tue, 17 Apr 2018 16:32:03 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0C77CF3246; Tue, 17 Apr 2018 16:32:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tabish@apache.org To: commits@activemq.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: activemq-artemis git commit: NO-JIRA Fix a couple random test failures Date: Tue, 17 Apr 2018 16:32:03 +0000 (UTC) Repository: activemq-artemis Updated Branches: refs/heads/master ae8b261c4 -> 98da402fb NO-JIRA Fix a couple random test failures Need to add a couple wait conditions to ensure valid stats are checked. Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/98da402f Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/98da402f Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/98da402f Branch: refs/heads/master Commit: 98da402fb6aef8b91d90091b69a7eed5df164ce7 Parents: ae8b261 Author: Timothy Bish Authored: Tue Apr 17 12:31:26 2018 -0400 Committer: Timothy Bish Committed: Tue Apr 17 12:31:26 2018 -0400 ---------------------------------------------------------------------- .../integration/amqp/AmqpSendReceiveTest.java | 33 ++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/98da402f/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java ---------------------------------------------------------------------- diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java index fc4d9ad..ea62df8 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/AmqpSendReceiveTest.java @@ -16,6 +16,20 @@ */ package org.apache.activemq.artemis.tests.integration.amqp; +import static org.apache.activemq.transport.amqp.AmqpSupport.contains; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +import javax.jms.Topic; + import org.apache.activemq.artemis.api.core.RoutingType; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.config.BridgeConfiguration; @@ -37,19 +51,6 @@ import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.jms.Topic; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; - -import static org.apache.activemq.transport.amqp.AmqpSupport.contains; - /** * Test basic send and receive scenarios using only AMQP sender and receiver links. */ @@ -89,7 +90,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { Queue queue = getProxyToQueue(getQueueName()); assertNotNull(queue); - assertEquals(0, queue.getMessageCount()); + Wait.assertEquals(0, queue::getMessageCount); } @Test(timeout = 60000) @@ -288,7 +289,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { receiver1.close(); receiver2.close(); - assertEquals(0, queueView.getMessageCount()); + Wait.assertEquals(0, queueView::getMessageCount); connection.close(); } @@ -341,7 +342,7 @@ public class AmqpSendReceiveTest extends AmqpClientTestSupport { receiver2.close(); - assertEquals(MSG_COUNT - 2, queueView.getMessageCount()); + Wait.assertEquals(MSG_COUNT - 2, queueView::getMessageCount); connection.close(); }