Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C494A952E for ; Thu, 9 Feb 2012 16:55:52 +0000 (UTC) Received: (qmail 30676 invoked by uid 500); 9 Feb 2012 16:55:52 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 30619 invoked by uid 500); 9 Feb 2012 16:55:52 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 30610 invoked by uid 99); 9 Feb 2012 16:55:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2012 16:55:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Feb 2012 16:55:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1CB24238897D for ; Thu, 9 Feb 2012 16:55:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1242399 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java Date: Thu, 09 Feb 2012 16:55:31 -0000 To: commits@qpid.apache.org From: kwall@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120209165531.1CB24238897D@eris.apache.org> Author: kwall Date: Thu Feb 9 16:55:30 2012 New Revision: 1242399 URL: http://svn.apache.org/viewvc?rev=1242399&view=rev Log: QPID-3825: TransactionTimeoutTest.testProducerOpenCommit and others fails sporadically on slower boxes The test needs to sync() after sending the last test message in order that the test and broker start measuring the idle transaction from the same point in time. Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java?rev=1242399&r1=1242398&r2=1242399&view=diff ============================================================================== --- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java (original) +++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java Thu Feb 9 16:55:30 2012 @@ -26,6 +26,7 @@ import org.apache.qpid.AMQException; import org.apache.qpid.client.AMQConnection; import org.apache.qpid.client.AMQConnectionURL; import org.apache.qpid.client.AMQQueue; +import org.apache.qpid.client.AMQSession; import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.jms.ConnectionURL; import org.apache.qpid.jms.Session; @@ -137,16 +138,21 @@ public abstract class TransactionTimeout /** * Send a number of messages to the queue, optionally pausing after each. + * + * Need to sync to ensure that the Broker has received the message(s) in order + * the test and broker start timing the idle transaction from the same point in time. */ protected void send(int count, float delay) throws Exception { for (int i = 0; i < count; i++) { - sleep(delay); + sleep(delay); Message msg = _psession.createTextMessage(TEXT); msg.setIntProperty("i", i); - _producer.send(msg); + _producer.send(msg); } + + ((AMQSession)_psession).sync(); } /** --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscribe@qpid.apache.org