From 63404804830d47bef03ccac1d323a47b1ede1158 Mon Sep 17 00:00:00 2001 From: Sebastien Robin <seb@nexedi.com> Date: Wed, 16 Mar 2011 16:13:22 +0000 Subject: [PATCH] do not execute more than 900 times uselessly this loop when it is not needed, this makes unit test reporting infinite activity loop much more faster git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44365 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/tests/ProcessingNodeTestCase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product/ERP5Type/tests/ProcessingNodeTestCase.py b/product/ERP5Type/tests/ProcessingNodeTestCase.py index 904770c050..4f5a95b750 100644 --- a/product/ERP5Type/tests/ProcessingNodeTestCase.py +++ b/product/ERP5Type/tests/ProcessingNodeTestCase.py @@ -169,7 +169,8 @@ class ProcessingNodeTestCase(backportUnittest.TestCase, ZopeTestCase.TestCase): message_count = len(message_list) # This prevents an infinite loop. count -= 1 - if count == 0: + if count == 0 or (message_count and set([x.processing_node for x in + message_list]).issubset(set([-2, -3]))): error_message = 'tic is looping forever. ' try: self.assertNoPendingMessage() -- 2.30.9