You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2014/02/07 15:59:02 UTC

svn commit: r1565670 - /qpid/dispatch/trunk/tests/system_tests_two_routers.py

Author: tross
Date: Fri Feb  7 14:59:02 2014
New Revision: 1565670

URL: http://svn.apache.org/r1565670
Log:
DISPATCH-27 - Make the wait-for-stable process more thorough

Modified:
    qpid/dispatch/trunk/tests/system_tests_two_routers.py

Modified: qpid/dispatch/trunk/tests/system_tests_two_routers.py
URL: http://svn.apache.org/viewvc/qpid/dispatch/trunk/tests/system_tests_two_routers.py?rev=1565670&r1=1565669&r2=1565670&view=diff
==============================================================================
--- qpid/dispatch/trunk/tests/system_tests_two_routers.py (original)
+++ qpid/dispatch/trunk/tests/system_tests_two_routers.py Fri Feb  7 14:59:02 2014
@@ -46,6 +46,26 @@ def wait_for_addr(messenger, addr, local
                 done = True
         time.sleep(0.2)
 
+def wait_for_routethrough(messenger, addr):
+    msub  = messenger.subscribe("amqp:/#")
+    reply = msub.address
+    req   = Message()
+    rsp   = Message()
+
+    done = False
+    while not done:
+        req.address    = "amqp:/_topo/0/%s/$management" % addr
+        req.reply_to   = reply
+        req.properties = {u'operation':u'GET-OPERATIONS', u'type':u'org.amqp.management', u'name':u'self'}
+        messenger.put(req)
+        messenger.send()
+        try:
+            messenger.recv()
+            done = True
+        except Exception:
+            pass
+        time.sleep(0.2)
+
 def startRouter(obj):
     default_home = os.path.normpath('/usr/lib/qpid-dispatch')
     home = os.environ.get('QPID_DISPATCH_HOME', default_home)
@@ -74,11 +94,11 @@ def startRouter(obj):
     M1.start()
     M2.start()
 
-    M1.timeout = 1.0
-    M2.timeout = 1.0
+    M1.timeout = 0.5
+    M2.timeout = 0.5
 
-    wait_for_addr(M1, "QDR.B", 0, 1)
-    wait_for_addr(M2, "QDR.A", 0, 1)
+    wait_for_routethrough(M1, "QDR.B")
+    wait_for_routethrough(M2, "QDR.A")
 
     M1.stop()
     M2.stop()



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org