summaryrefslogtreecommitdiff
path: root/qpid/java/systests/src
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2014-06-03 22:13:59 +0000
committerKeith Wall <kwall@apache.org>2014-06-03 22:13:59 +0000
commit61bd69531da409a8c1550bbc67b59a222175b23f (patch)
tree47d827d47527b30d3a44f36dcc8319ba5f6f3e87 /qpid/java/systests/src
parentf3599d8e82635c80242e2c7b6047f2e20d4b9735 (diff)
downloadqpid-python-61bd69531da409a8c1550bbc67b59a222175b23f.tar.gz
QPID-5798: [Java Broker Tests] Intermittent failure of FailoverBehaviourTest due to race condition within test
Work by Andrew MacBean <andymacbean@gmail.com> git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1599809 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java7
1 files changed, 6 insertions, 1 deletions
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;