Skip to content

Commit 3110116

Browse files
dumbbellmergify[bot]
authored andcommitted
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. (cherry picked from commit 0fb74ba)
1 parent 7c85b5d commit 3110116

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
@@ -722,10 +722,12 @@ shrink_coordinator_cluster(Config) ->
722722
rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
723723
Q = ?config(queue_name, Config),
724724

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

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

0 commit comments

Comments
 (0)