Commit cbbf356d authored by Julien Muchembled's avatar Julien Muchembled

Fix testDeferredConnection by making tearDown more tolerant

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@38219 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b94cb013
...@@ -1011,16 +1011,17 @@ class ERP5TypeTestCase(ProcessingNodeTestCase, PortalTestCase): ...@@ -1011,16 +1011,17 @@ class ERP5TypeTestCase(ProcessingNodeTestCase, PortalTestCase):
# so we do nothing in persistent mode (--save). # so we do nothing in persistent mode (--save).
try: try:
portal_activities = self.portal.portal_activities portal_activities = self.portal.portal_activities
except AttributeError: message_list = portal_activities.getMessageList()
except StandardError: # AttributeError, TransactionFailedError ...
pass pass
else: else:
for m in portal_activities.getMessageList(): for m in message_list:
if m.processing_node < -1: if m.processing_node < -1:
transaction.abort() transaction.abort()
count = portal_activities.countMessage() count = portal_activities.countMessage()
portal_activities.manageClearActivities(keep=False) portal_activities.manageClearActivities(keep=False)
transaction.commit() transaction.commit()
ZopeTestCase._print('\ndropped %d left-over activity messages' ZopeTestCase._print(' (dropped %d left-over activity messages) '
% count) % count)
break break
PortalTestCase.tearDown(self) PortalTestCase.tearDown(self)
......
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