Commit 598732da authored by Jérome Perrin's avatar Jérome Perrin Committed by Kazuhiko Shiozaki

ProcessingNodeTestCase: Adjust _p_resolveConflict for more than 2 nodes

Usually we run tests with two nodes, so when there's a conflict it's
always between the "main" node and the processing node, so we always
have a distributing node during conflict.

But when running with, for example, 2 nodes (the main node + 2 nodes),
the conflict might occur between the two processing nodes and after
the resolution we still don't have a distributing node.
parent 12d3ee0f
......@@ -108,9 +108,11 @@ def Application_resolveConflict(self, old_state, saved_state, new_state):
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()
new_state['test_distributing_node'] = ''
if test_distributing_node_set:
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)]
......
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