Skip to content

Commit 699c455

Browse files
committed
partitions_SUITE: Try to improve partial_pause_minority
The testcase simulates a partial partition which should be detected by the two nodes on each side of the partition. They should both decide there is a partial partition and stop. However, sometimes one of the node is faster than the other one: it sees the partial partition and stops before the second node even sees the partition. When this happens, the second node doesn't even bother to stop (because the partition is full now). Thus the testcase fails because it expects both nodes to stop. This patch tries to sync partial partition checks so both A and B decide there is a partial partition. [#146911969]
1 parent 0bd9368 commit 699c455

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/partitions_SUITE.erl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,19 @@ partial_to_full(Config) ->
379379
partial_pause_minority(Config) ->
380380
[A, B, C] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
381381
set_mode(Config, pause_minority),
382+
%% We suspend rabbit_node_monitor on C while we block the link
383+
%% between A and B. This should make sure C's rabbit_node_monitor
384+
%% processes both partial partition checks from A and B at about
385+
%% the same time, and thus increase the chance both A and B decides
386+
%% there is a partial partition.
387+
%%
388+
%% Without this, one node may see the partial partition and stop,
389+
%% before the other node sees it. In this case, the other node
390+
%% doesn't stop and this testcase fails.
391+
suspend_node_monitor(Config, C),
382392
block([{A, B}]),
393+
timer:sleep(?DELAY),
394+
resume_node_monitor(Config, C),
383395
[await_running(N, false) || N <- [A, B]],
384396
await_running(C, true),
385397
unblock([{A, B}]),

0 commit comments

Comments
 (0)