Commit 6be5aed8 authored by Leonardo Rochael Almeida's avatar Leonardo Rochael Almeida Committed by Sebastien Robin

Tests: stop_condition() should always be able to prevent failure on tic()

The stop_condition() check is run once every beginning of loop tic, but if a loop
achieved a state of total failure, RuntimeError was raised before stop_condition()
had a chance to run.

So we call it again just one more time to see if we can avoid failing.
parent 32feee12
......@@ -224,6 +224,10 @@ class ProcessingNodeTestCase(backportUnittest.TestCase, ZopeTestCase.TestCase):
count -= 1
if count == 0 or (message_count and set([x.processing_node for x in
message_list]).issubset(set([-2, -3]))):
# We're about to raise RuntimeError, but maybe we've reached
# the stop condition, so check just once more:
if stop_condition(message_list):
break
error_message = 'tic is looping forever. '
try:
self.assertNoPendingMessage()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment