From 61bd69531da409a8c1550bbc67b59a222175b23f Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Tue, 3 Jun 2014 22:13:59 +0000 Subject: QPID-5798: [Java Broker Tests] Intermittent failure of FailoverBehaviourTest due to race condition within test Work by Andrew MacBean git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1599809 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/client/failover/FailoverBehaviourTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'qpid/java') diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java index 8822fc5373..0c6a14070f 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java @@ -18,6 +18,7 @@ */ package org.apache.qpid.client.failover; +import org.apache.qpid.AMQException; import org.apache.qpid.client.AMQConnection; import org.apache.qpid.client.AMQConnectionFactory; import org.apache.qpid.client.AMQDestination; @@ -1347,7 +1348,7 @@ public class FailoverBehaviourTest extends FailoverBaseCase implements Connectio * @return queue browser * @throws JMSException */ - private QueueBrowser prepareQueueBrowser(int acknowledgeMode) throws JMSException + private QueueBrowser prepareQueueBrowser(int acknowledgeMode) throws JMSException, AMQException { init(acknowledgeMode, false); _consumer.close(); @@ -1358,6 +1359,10 @@ public class FailoverBehaviourTest extends FailoverBaseCase implements Connectio { _producerSession.commit(); } + else + { + ((AMQSession)_producerSession).sync(); + } QueueBrowser browser = _consumerSession.createBrowser((Queue) _destination); return browser; -- cgit v1.2.1