You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ch...@apache.org on 2018/07/10 22:33:43 UTC

qpid-dispatch git commit: DISPATCH-1008: Failover test waits for inter-router status

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 42a4666f1 -> cc3ab6557


DISPATCH-1008: Failover test waits for inter-router status

After Router A fails over from B to C, wait for the inter-router
connection to RouterC to show up in RouterC's management stack
before declaring an error.


Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/cc3ab655
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/cc3ab655
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/cc3ab655

Branch: refs/heads/master
Commit: cc3ab65578701dd0df262ce346f0443cc21b9975
Parents: 42a4666
Author: Chuck Rolke <cr...@redhat.com>
Authored: Tue Jul 10 18:30:46 2018 -0400
Committer: Chuck Rolke <cr...@redhat.com>
Committed: Tue Jul 10 18:30:46 2018 -0400

----------------------------------------------------------------------
 tests/system_tests_handle_failover.py | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/cc3ab655/tests/system_tests_handle_failover.py
----------------------------------------------------------------------
diff --git a/tests/system_tests_handle_failover.py b/tests/system_tests_handle_failover.py
index 97d7a23..8ff6311 100644
--- a/tests/system_tests_handle_failover.py
+++ b/tests/system_tests_handle_failover.py
@@ -146,6 +146,7 @@ class FailoverTest(TestCase):
         # Router A should now try to connect to Router C. Router C does NOT have failoverUrls.
         # Query Router A which previously had failoverUrls in its connector (because Router B sent it failoverUrls)
         # does not have it anymore.
+        # Further wait for the connection from Router A to show up in Router C's management stack
         long_type = 'org.apache.qpid.dispatch.connector'
         query_command = 'QUERY --type=' + long_type
         output = json.loads(self.run_qdmanage(query_command, address=self.routers[1].addresses[0]))
@@ -153,10 +154,16 @@ class FailoverTest(TestCase):
         expected = FailoverTest.backup_url  + ", " + "amqp://127.0.0.1:" + str(FailoverTest.inter_router_port) \
                    + ", " + "amqp://third-host:5671"
 
-        if output[0].get('failoverUrls') == expected:
-            self.success = True
-        else:
+        if output[0].get('failoverUrls') != expected:
             self.schedule_B_to_C_failover_test()
+        else:
+            # Router A now sees the proper failover list when connected to Router C
+            # Stall until an inter-router connection shows up in Router C's status
+            outs = self.run_qdstat(['--connections'], address=self.routers[2].addresses[1])
+            if not "inter-router" in outs:
+                self.schedule_B_to_C_failover_test()
+            else:
+                self.success = True
 
     def can_terminate(self):
         if self.attempts == self.max_attempts:
@@ -178,6 +185,7 @@ class FailoverTest(TestCase):
         FailoverTest.routers[0].teardown()
 
         # Schedule a test to make sure that the failover url is available
+        # and Router C has an inter-router connection
         self.schedule_B_to_C_failover_test()
 
         while not self.can_terminate():
@@ -237,4 +245,4 @@ class FailoverTest(TestCase):
 
 
 if __name__ == '__main__':
-    unittest.main(main_module())
\ No newline at end of file
+    unittest.main(main_module())


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