kgiusti commented on a change in pull request #988:
URL: https://github.com/apache/qpid-dispatch/pull/988#discussion_r559803677
##########
File path: tests/system_tests_link_routes.py
##########
@@ -2348,6 +2348,65 @@ def run(self):
Container(self).run()
+class DispositionSniffer(MessagingHandler):
+ """
+ Capture the outgoing delivery after the remote has set its terminal
+ outcome. Used by tests that need to examine the delivery state
+ """
+ def __init__(self, send_url):
+ super(DispositionSniffer, self).__init__(auto_accept=False,
+ auto_settle=False)
+ self.send_url = send_url
+ self.sender = None
+ self.timer = None
+ self.error = None
+ self.sent = False
+ self.delivery = None
+
+ def close(self):
+ if self.timer:
+ self.timer.cancel()
+ if self.sender:
+ self.sender.close()
+ self.sender.connection.close()
+
+ def timeout(self):
+ self.error = "Timeout Expired - Check for cores"
+ self.close()
+
+ def stop(self):
+ self.close()
+
+ def on_start(self, event):
+ self.timer = event.reactor.schedule(TIMEOUT, TestTimeout(self))
+ self.sender = event.container.create_sender(self.send_url)
+
+ def on_sendable(self, event):
+ if not self.sent:
+ event.sender.send(Message(body="HI"))
+ self.sent = True
+
+ def on_accepted(self, event):
+ self.stop()
+
+ def on_released(self, event):
+ # event.delivery.remote_state
Review comment:
note to self: remove!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]