Author: kwall
Date: Tue Jun  3 22:13:59 2014
New Revision: 1599809

URL: http://svn.apache.org/r1599809
Log:
QPID-5798: [Java Broker Tests] Intermittent failure of FailoverBehaviourTest 
due to race condition within test

Work by Andrew MacBean <[email protected]>

Modified:
    
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java

Modified: 
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java?rev=1599809&r1=1599808&r2=1599809&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java
 (original)
+++ 
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/failover/FailoverBehaviourTest.java
 Tue Jun  3 22:13:59 2014
@@ -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 exten
      * @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 exten
         {
             _producerSession.commit();
         }
+        else
+        {
+            ((AMQSession)_producerSession).sync();
+        }
 
         QueueBrowser browser = _consumerSession.createBrowser((Queue) 
_destination);
         return browser;



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to