summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2012-02-09 16:55:30 +0000
committerKeith Wall <kwall@apache.org>2012-02-09 16:55:30 +0000
commitad10e6cfc117b48e09ade71b312a04f06200330a (patch)
treeb209793d24a94c314c2f419cf9bf3824bd272b75
parentb76d90af9f4f80f90f03d26b592b3053f7de77ee (diff)
downloadqpid-python-ad10e6cfc117b48e09ade71b312a04f06200330a.tar.gz
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. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1242399 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java b/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java
index 19f5073ec5..499e280ff3 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTestCase.java
@@ -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 TransactionTimeoutTestCase extends QpidBrokerTestCase impl
/**
* 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();
}
/**