Commit e50bcc8b authored by Jérome Perrin's avatar Jérome Perrin

ProcessingNodeTestCase: resolve conflicts on test_distributing_node

When other zope nodes takes time to start this sometimes causes
conflict.
parent 5cff0e99
...@@ -100,6 +100,16 @@ def Application_resolveConflict(self, old_state, saved_state, new_state): ...@@ -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 """Solve conflicts in case several nodes register at the same time
""" """
new_state = new_state.copy() 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()) old, saved, new = [set(state.pop('test_processing_nodes', {}).items())
for state in old_state, saved_state, new_state] for state in old_state, saved_state, new_state]
# The value of these attributes don't have proper __eq__ implementation. # The value of these attributes don't have proper __eq__ implementation.
......
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