summaryrefslogtreecommitdiff
path: root/java
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
commit0bb9caf8bec9e755e29595b170102ac939c93094 (patch)
treeb209793d24a94c314c2f419cf9bf3824bd272b75 /java
parentcb62dfd2617a3d0026ee90a78d912a22bb8c854f (diff)
downloadqpid-python-0bb9caf8bec9e755e29595b170102ac939c93094.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
Diffstat (limited to 'java')
-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();
}
/**