Fixed system_tests_fallback_dest test to send expected number of messages
@@ -692,12 +692,15 @@ class SenderFirstAutoLinkTest(MessagingHandler):
if event.sender == self.sender:
self.receiver_conn = event.container.connect(self.receiver_host)
- def on_sendable(self, event):
- if event.sender == self.sender:
+ def send(self):
while self.sender.credit > 0 and self.n_tx < self.count:
self.sender.send(Message("Message %d" % self.n_tx))
self.n_tx += 1
+ def on_sendable(self, event):
+ if event.sender == self.sender:
+ self.send()
+
def on_message(self, event):
self.n_rx += 1
if self.n_rx == self.count:
@@ -706,6 +709,7 @@ class SenderFirstAutoLinkTest(MessagingHandler):
def on_released(self, event):
self.n_rel += 1
self.n_tx -= 1
+ self.send()
def run(self):
Container(self).run()
@@ -758,12 +762,15 @@ class ReceiverFirstAutoLinkTest(MessagingHandler):
self.sender_conn = event.container.connect(self.sender_host)
self.sender = event.container.create_sender(self.sender_conn, self.addr)
- def on_sendable(self, event):
- if event.sender == self.sender:
+ def send(self):
while self.sender.credit > 0 and self.n_tx < self.count:
self.sender.send(Message("Message %d" % self.n_tx))
self.n_tx += 1
+ def on_sendable(self, event):
+ if event.sender == self.sender:
+ self.send()
+
def on_message(self, event):
self.n_rx += 1
if self.n_rx == self.count:
@@ -772,6 +779,7 @@ class ReceiverFirstAutoLinkTest(MessagingHandler):
def on_released(self, event):
self.n_rel += 1
self.n_tx -= 1
+ self.send()
def run(self):
Container(self).run()
