Skip to content

Commit 95cabda

Browse files
committed
Use awaitMatch to wait for proper qq status
1 parent acf43fb commit 95cabda

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

deps/rabbit/test/quorum_queue_SUITE.erl

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4987,17 +4987,18 @@ restart_after_queue_reincarnation(Config) ->
49874987
%% Restart S3
49884988
?assertEqual(ok, rabbit_control_helper:command(start_app, S3)),
49894989

4990-
timer:sleep(1000),
4991-
4992-
%% Now all three nodes should have the new state.
4990+
?awaitMatch(true, begin
4991+
%% Now all three nodes should have the new state.
4992+
% They are either leader or follower.
4993+
Status2 = rabbit_ct_broker_helpers:rpc(Config, 0, rabbit_quorum_queue, status, [VHost, QName]),
4994+
lists:all(
4995+
fun(NodeStatus) ->
4996+
NodeRaftState = proplists:get_value(<<"Raft State">>, NodeStatus),
4997+
lists:member(NodeRaftState, [leader, follower])
4998+
end, Status2)
4999+
end, ?DEFAULT_AWAIT),
49935000
Status2 = rabbit_ct_broker_helpers:rpc(Config, 0, rabbit_quorum_queue, status, [VHost, QName]),
4994-
% They are either leader or follower.
4995-
?assert(
4996-
lists:all(
4997-
fun(NodeStatus) ->
4998-
NodeRaftState = proplists:get_value(<<"Raft State">>, NodeStatus),
4999-
lists:member(NodeRaftState, [leader, follower])
5000-
end, Status2)),
5001+
50015002
% Remove "Node Name" and "Raft State" from the status.
50025003
Status3 = [NE1, NE2, NE3]= [
50035004
begin

0 commit comments

Comments
 (0)