Skip to content

Commit 7166357

Browse files
committed
cluster_minority_SUITE: Fix race in remove_node_when_seed_node_is_leader
[Why] When node A becomes the leader, it still takes a few exchanges with followers to allow cluster changes again. Concurrently, the testcase blocks traffic between A and other nodes to simulate a network partition. If this happens after A becomes the leader but before cluster changes are permitted again, the testcase will never succeed and will eventually abort with: Case: cluster_minority_SUITE:remove_node_when_seed_node_is_leader Reason: {error, {{awaitMatch, [{module,cluster_minority_SUITE}, {expression, "..."}, {pattern,"ok"}, {value, {error,69,<<"Error:\ncluster_change_not_permitted">>}}]}, [How] Before blocking traffic, we wait for cluster changes to be permitted again on node A.
1 parent d890cf1 commit 7166357

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deps/rabbit/test/cluster_minority_SUITE.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,10 @@ remove_node_when_seed_node_is_leader(Config) ->
395395
ct:pal("Member A state: ~0p", [Pong]),
396396
case Pong of
397397
{pong, leader} ->
398+
?awaitMatch(
399+
{ok, #{cluster_change_permitted := true}, _},
400+
rabbit_ct_broker_helpers:rpc(Config, A, ra, member_overview, [AMember]),
401+
60000),
398402
?awaitMatch(
399403
ok,
400404
rabbit_control_helper:command(

0 commit comments

Comments
 (0)