From d73463025fb41d3cb6e400988754964ca4f40b19 Mon Sep 17 00:00:00 2001 From: Sebastien Robin <seb@nexedi.com> Date: Mon, 26 Nov 2007 16:04:57 +0000 Subject: [PATCH] - the behavior has changed, it is better to keep messages wich fails into SQLDict, even if another message with the same method on the same objects works after. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17793 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5/tests/testAlarm.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/product/ERP5/tests/testAlarm.py b/product/ERP5/tests/testAlarm.py index ac81b41a7c..35b29b4d75 100644 --- a/product/ERP5/tests/testAlarm.py +++ b/product/ERP5/tests/testAlarm.py @@ -436,14 +436,15 @@ class TestAlarm(ERP5TypeTestCase): self.getPortal().portal_skins[skin_folder_id][sense_method_id].ZPythonScript_edit('*args,**kw', 'context.newActiveProcess()') alarm.activeSense() get_transaction().commit() - # Note: this call to tic will not fail, because the same method on the same - # object is activated again in SQLDict. When the new message will be - # -successfully- processed, the previous -failed- message will get removed - # in the cleanup. This behaviour is logical if we consider that manually - # executing the failed message to get the error will lead to no error. - # But it can also be considered illogical if failed messages are supposed - # to be preserved for future analysis. - self.tic() + # Note: this call to tic will fail, because the previous message is still there + # This behaviour is logical if we consider that we want to keep errors + # in order to know that an error occured. + try: + self.tic() + except RuntimeError: + pass + else: + raise Exception, 'Tic did not raise though activity was supposed to fail' # Chen that the second alarm execution did happen self.assertNotEquals(alarm.getLastActiveProcess(), None) -- 2.30.9