Skip to content

Commit 94f884c

Browse files
committed
quorum_queue_SUITE
1 parent 6aeef0d commit 94f884c

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

deps/rabbit/test/quorum_queue_SUITE.erl

+13-3
Original file line numberDiff line numberDiff line change
@@ -2485,11 +2485,21 @@ confirm_availability_on_leader_change(Config) ->
24852485
ok.
24862486

24872487
wait_for_new_messages(Config, Node, Name, Increase) ->
2488+
wait_for_new_messages(Config, Node, Name, Increase, 60000).
2489+
2490+
wait_for_new_messages(Config, Node, Name, Increase, Timeout) ->
24882491
Infos = rabbit_ct_broker_helpers:rabbitmqctl_list(
24892492
Config, Node, ["list_queues", "name", "messages"]),
2490-
[[Name, Msgs0]] = [Props || Props <- Infos, hd(Props) == Name],
2491-
Msgs = binary_to_integer(Msgs0),
2492-
queue_utils:wait_for_min_messages(Config, Name, Msgs + Increase).
2493+
case [Props || Props <- Infos, hd(Props) == Name] of
2494+
[[Name, Msgs0]] ->
2495+
Msgs = binary_to_integer(Msgs0),
2496+
queue_utils:wait_for_min_messages(Config, Name, Msgs + Increase);
2497+
_ when Timeout >= 0 ->
2498+
Sleep = 200,
2499+
timer:sleep(Sleep),
2500+
wait_for_new_messages(
2501+
Config, Node, Name, Increase, Timeout - Sleep)
2502+
end.
24932503

24942504
flush(T) ->
24952505
receive X ->

0 commit comments

Comments
 (0)