diff options
| author | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2017-06-08 16:57:49 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2017-06-13 12:12:47 +0200 |
| commit | 699c45508a95ea568eef9fe3f1e9c9e912669c8a (patch) | |
| tree | fe92435ea9f32311f8e4ab2216ced839df54787b | |
| parent | 0bd9368048704de5464605896a6c09befd173221 (diff) | |
| download | rabbitmq-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]
| -rw-r--r-- | test/partitions_SUITE.erl | 12 |
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}]), |
