summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2017-06-08 16:57:49 +0200
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2017-06-13 12:12:47 +0200
commit699c45508a95ea568eef9fe3f1e9c9e912669c8a (patch)
treefe92435ea9f32311f8e4ab2216ced839df54787b /test
parent0bd9368048704de5464605896a6c09befd173221 (diff)
downloadrabbitmq-server-git-699c45508a95ea568eef9fe3f1e9c9e912669c8a.tar.gz
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]
Diffstat (limited to 'test')
-rw-r--r--test/partitions_SUITE.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/partitions_SUITE.erl b/test/partitions_SUITE.erl
index f7c452e3be..b09d05b550 100644
--- a/test/partitions_SUITE.erl
+++ b/test/partitions_SUITE.erl
@@ -379,7 +379,19 @@ partial_to_full(Config) ->
partial_pause_minority(Config) ->
[A, B, C] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
set_mode(Config, pause_minority),
+ %% We suspend rabbit_node_monitor on C while we block the link
+ %% between A and B. This should make sure C's rabbit_node_monitor
+ %% processes both partial partition checks from A and B at about
+ %% the same time, and thus increase the chance both A and B decides
+ %% there is a partial partition.
+ %%
+ %% Without this, one node may see the partial partition and stop,
+ %% before the other node sees it. In this case, the other node
+ %% doesn't stop and this testcase fails.
+ suspend_node_monitor(Config, C),
block([{A, B}]),
+ timer:sleep(?DELAY),
+ resume_node_monitor(Config, C),
[await_running(N, false) || N <- [A, B]],
await_running(C, true),
unblock([{A, B}]),