Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B1059200C68 for ; Wed, 3 May 2017 22:41:50 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id AFC98160BBA; Wed, 3 May 2017 20:41:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0BEEE160BA1 for ; Wed, 3 May 2017 22:41:49 +0200 (CEST) Received: (qmail 31725 invoked by uid 500); 3 May 2017 20:41:49 -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 31716 invoked by uid 99); 3 May 2017 20:41:49 -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; Wed, 03 May 2017 20:41:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 25282E04AA; Wed, 3 May 2017 20:41:49 +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 Date: Wed, 03 May 2017 20:41:50 -0000 Message-Id: <822c276201b845f9b4e299df024c333b@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] activemq-artemis git commit: ARTEMIS-1140: Trivial test fix archived-at: Wed, 03 May 2017 20:41:50 -0000 ARTEMIS-1140: Trivial test fix (cherry picked from commit 0146109d6a06f9702f245034a43c49dffc5779bd) Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/468b8a95 Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/468b8a95 Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/468b8a95 Branch: refs/heads/1.x Commit: 468b8a954bb4d2a163908fb8edb7a284b7b32b86 Parents: 534fd80 Author: Clebert Suconic Authored: Wed May 3 16:12:01 2017 -0400 Committer: Clebert Suconic Committed: Wed May 3 16:41:42 2017 -0400 ---------------------------------------------------------------------- .../artemis/jms/tests/ActiveMQServerTestCase.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/468b8a95/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java ---------------------------------------------------------------------- diff --git a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java index 42d6ea5..c65f0cd 100644 --- a/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java +++ b/tests/jms-tests/src/test/java/org/apache/activemq/artemis/jms/tests/ActiveMQServerTestCase.java @@ -371,7 +371,15 @@ public abstract class ActiveMQServerTestCase { if (binding != null && binding instanceof LocalQueueBinding) { ((LocalQueueBinding) binding).getQueue().flushExecutor(); } - Long messageCount = ActiveMQServerTestCase.servers.get(0).getMessageCountForQueue(queueName); + Long messageCount = null; + for (int i = 0; i < 10; i++) { + messageCount = servers.get(0).getMessageCountForQueue(queueName); + if (messageCount.longValue() == expected) { + break; + } else { + Thread.sleep(100); + } + } ProxyAssertSupport.assertEquals(expected, messageCount.intValue()); return expected == messageCount.intValue();