qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gmur...@apache.org
Subject [qpid-dispatch] branch master updated: DISPATCH-1677 - Waited till the connections and the links are created before calling UptimeLastDlvChecker. This closes #758
Date Wed, 10 Jun 2020 14:41:36 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 9859e0d  DISPATCH-1677 - Waited till the connections and the links are created before
calling UptimeLastDlvChecker. This closes #758
9859e0d is described below

commit 9859e0d0a21605eaf59013e817e83ba70f59005a
Author: Ganesh Murthy <gmurthy@apache.org>
AuthorDate: Tue Jun 9 12:36:02 2020 -0400

    DISPATCH-1677 - Waited till the connections and the links are created before calling UptimeLastDlvChecker.
This closes #758
---
 tests/system_tests_one_router.py | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/tests/system_tests_one_router.py b/tests/system_tests_one_router.py
index 5f0aed1..e349918 100644
--- a/tests/system_tests_one_router.py
+++ b/tests/system_tests_one_router.py
@@ -2975,6 +2975,9 @@ class ConnectionUptimeLastDlvTest(MessagingHandler):
         self.dest = dest
         self.reactor = None
         self.success = False
+        self.receiver_link_opened = False
+        self.sender_link_opened = False
+        self.custom_timer_created = False
 
     def cancel_custom(self):
         self.custom_timer.cancel()
@@ -3001,6 +3004,8 @@ class ConnectionUptimeLastDlvTest(MessagingHandler):
 
     def on_start(self, event):
         self.timer = event.reactor.schedule(TIMEOUT, TestTimeout(self))
+
+        # Create separate sender and receiver connections.
         self.sender_conn = event.container.connect(self.address)
         self.receiver_conn = event.container.connect(self.address)
 
@@ -3012,7 +3017,23 @@ class ConnectionUptimeLastDlvTest(MessagingHandler):
         # This will help us check the uptime and lastDlv time
         # No deliveries were sent on any link yet, so the lastDlv must be "-"
         self.reactor = event.reactor
-        self.custom_timer = event.reactor.schedule(1, UptimeLastDlvChecker(self, uptime=1,
lastDlv=None))
+
+
+    def on_link_opened(self, event):
+        # Schedule the UptimeLastDlvChecker only after the sender and
+        # receiver links have been opened on those connections. This
+        # will help the test pass 100% of the time in slow systems.
+        if self.receiver == event.receiver:
+            self.receiver_link_opened = True
+        if event.sender == self.sender:
+            self.sender_link_opened = True
+
+        if self.receiver_link_opened and self.sender_link_opened:
+            if not self.custom_timer_created:
+                self.custom_timer_created = True
+                self.custom_timer = event.reactor.schedule(1, UptimeLastDlvChecker(self,
uptime=1,
+                                                                                   lastDlv=None))
+
 
     def run(self):
         container = Container(self)


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


Mime
View raw message