Skip to content

Commit 0fb74ba

Browse files
committed
rabbit_stream_queue_SUITE: Wait for replicas in shrink_coordinator_cluster/1
[Why] In CI, we sometimes get a failure when we try to forget node 3. The CLI doesn't report the nature of the error unfortunately. I suppose it's related to the fact that node 3 is stopped and forgotten before all three replicas were ready when the stream queue was declared. This is just a guess though and have no proof that it is the actual error. [How] We wait for the replicas after declaring the stream queue.
1 parent a44d541 commit 0fb74ba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

deps/rabbit/test/rabbit_stream_queue_SUITE.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,12 @@ shrink_coordinator_cluster(Config) ->
720720
rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
721721
Q = ?config(queue_name, Config),
722722

723-
724723
?assertEqual({'queue.declare_ok', Q, 0, 0},
725724
declare(Config, Server0, Q, [{<<"x-queue-type">>, longstr, <<"stream">>}])),
726725

726+
%% Wait for the replicas to be ready before stopping a node.
727+
check_leader_and_replicas(Config, [Server0, Server1, Server2]),
728+
727729
ok = rabbit_control_helper:command(stop_app, Server2),
728730
ok = rabbit_control_helper:command(forget_cluster_node, Server0, [atom_to_list(Server2)], []),
729731

0 commit comments

Comments
 (0)