You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gm...@apache.org on 2021/06/11 14:43:42 UTC

[qpid-dispatch] branch main updated: DISPATCH-1797: Added a retry to qdmanage to make sure we give enough time for addresses to be added to the router address table. This closes #1255

This is an automated email from the ASF dual-hosted git repository.

gmurthy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git


The following commit(s) were added to refs/heads/main by this push:
     new bbed464  DISPATCH-1797: Added a retry to qdmanage to make sure we give enough time for addresses to be added to the router address table. This closes #1255
bbed464 is described below

commit bbed4647dda6b1ce8ed332d5a831c73d79055466
Author: Ganesh Murthy <gm...@apache.org>
AuthorDate: Thu Jun 10 10:22:21 2021 -0400

    DISPATCH-1797: Added a retry to qdmanage to make sure we give enough time for addresses to be added to the router address table. This closes #1255
---
 tests/system_tests_qdmanage.py | 38 +++++++++++++++++---------------------
 1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/tests/system_tests_qdmanage.py b/tests/system_tests_qdmanage.py
index 0450bf1..81c7aa2 100644
--- a/tests/system_tests_qdmanage.py
+++ b/tests/system_tests_qdmanage.py
@@ -543,30 +543,29 @@ class QdmanageTest(TestCase):
         # This qdmanage query command would fail without the fix
         # for DISPATCH-974
         query_command = 'QUERY --type=org.apache.qpid.dispatch.router.address'
-        outs = json.loads(self.run_qdmanage(query_command))
-
-        sender_addresses = 0
-        receiver_addresses = 0
-
-        for out in outs:
-            if ADDRESS_SENDER in out['name']:
-                sender_addresses += 1
-            if ADDRESS_RECEIVER in out['name']:
-                receiver_addresses += 1
+        for i in range(3):
+            sender_addresses = 0
+            receiver_addresses = 0
+            outs = json.loads(self.run_qdmanage(query_command))
+            for out in outs:
+                if ADDRESS_SENDER in out['name']:
+                    sender_addresses += 1
+                if ADDRESS_RECEIVER in out['name']:
+                    receiver_addresses += 1
+            if sender_addresses < COUNT or receiver_addresses < COUNT:
+                sleep(2)
+            else:
+                break
 
         self.assertEqual(sender_addresses, COUNT)
         self.assertEqual(receiver_addresses, COUNT)
 
         query_command = 'QUERY --type=link'
-        outs = json.loads(self.run_qdmanage(query_command))
-
-        out_links = 0
-        in_links = 0
         success = False
-
-        i = 0
-        while i < 3:
-            i += 1
+        for i in range(3):
+            out_links = 0
+            in_links = 0
+            outs = json.loads(self.run_qdmanage(query_command))
             for out in outs:
                 if out.get('owningAddr'):
                     if ADDRESS_SENDER in out['owningAddr']:
@@ -581,9 +580,6 @@ class QdmanageTest(TestCase):
             if out_links < COUNT or in_links < COUNT:
                 self.logger.log("out_links=%s, in_links=%s" % (str(out_links), str(in_links)))
                 sleep(2)
-                outs = json.loads(self.run_qdmanage(query_command))
-                out_links = 0
-                in_links = 0
             else:
                 self.logger.log("Test success!")
                 success = True

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