Skip to content

Commit

Permalink
Made the stuck-delivery test less flakey.
Browse files Browse the repository at this point in the history
  • Loading branch information
ted-ross committed Apr 27, 2022
1 parent 5d181a5 commit 8d37e0a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/system_tests_stuck_deliveries.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def __init__(self, host):
self.addr = "rx/link/credit/test"
self.credit_issued = 0
self.error = None
self.get_baseline = True

self.stages = ['Setup', 'LinkBlocked', 'LinkUnblocked', '10Credits', '20Credits']
self.stage = 0
Expand Down Expand Up @@ -342,7 +343,10 @@ def on_message(self, event):
#
# LinkBlocked
#
if response.results[0].linksBlocked == 1:
if self.get_baseline:
self.get_baseline = False
self.baseline_blocked = response.results[0].linksBlocked
if response.results[0].linksBlocked == self.baseline_blocked + 1:
self.receiver.flow(10)
self.stage = 2
self.process()
Expand All @@ -352,7 +356,7 @@ def on_message(self, event):
#
# LinkUnblocked
#
if response.results[0].linksBlocked == 0:
if response.results[0].linksBlocked == self.baseline_blocked:
self.stage = 3
self.process()
return
Expand Down Expand Up @@ -398,6 +402,7 @@ def __init__(self, host):
self.addr = "rx/link/credit/test"
self.credit_issued = 0
self.error = None
self.get_baseline = True

self.stages = ['Setup', 'LinkBlocked', 'LinkUnblocked', '250Credits']
self.stage = 0
Expand Down Expand Up @@ -465,7 +470,10 @@ def on_message(self, event):
#
# LinkBlocked
#
if response.results[0].linksBlocked == 1:
if self.get_baseline:
self.get_baseline = False
self.baseline_blocked = response.results[0].linksBlocked
if response.results[0].linksBlocked == self.baseline_blocked + 1:
self.receiver = event.container.create_receiver(self.sender_conn, self.addr)
self.stage = 2
self.process()
Expand All @@ -475,7 +483,7 @@ def on_message(self, event):
#
# LinkUnblocked
#
if response.results[0].linksBlocked == 0:
if response.results[0].linksBlocked == self.baseline_blocked:
self.stage = 3
self.process()
return
Expand Down

0 comments on commit 8d37e0a

Please sign in to comment.