From e50bcc8ba1eb9c943150179193322ac0d1884c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Fri, 20 Sep 2019 09:58:29 +0200 Subject: [PATCH] ProcessingNodeTestCase: resolve conflicts on test_distributing_node When other zope nodes takes time to start this sometimes causes conflict. --- product/ERP5Type/tests/ProcessingNodeTestCase.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/product/ERP5Type/tests/ProcessingNodeTestCase.py b/product/ERP5Type/tests/ProcessingNodeTestCase.py index b4063a5521..02ac1625d0 100644 --- a/product/ERP5Type/tests/ProcessingNodeTestCase.py +++ b/product/ERP5Type/tests/ProcessingNodeTestCase.py @@ -100,6 +100,16 @@ def Application_resolveConflict(self, old_state, saved_state, new_state): """Solve conflicts in case several nodes register at the same time """ new_state = new_state.copy() + + test_distributing_node_set = { + old_state.pop('test_distributing_node', ''), + saved_state.pop('test_distributing_node', ''), + new_state.pop('test_distributing_node', '')} + test_distributing_node_set.discard('') + if len(test_distributing_node_set) != 1: + raise ConflictError + new_state['test_distributing_node'] = test_distributing_node_set.pop() + old, saved, new = [set(state.pop('test_processing_nodes', {}).items()) for state in old_state, saved_state, new_state] # The value of these attributes don't have proper __eq__ implementation. -- 2.30.9