Skip to content

Commit b05b4aa

Browse files
mkuratczykmergify[bot]
authored andcommitted
Test flakes may05 2026 (#16305)
* quorum_queue_SUITE: await condition Sometimes we can get `{error,4, {error, non_voters_found}}` if we don't wait * mqtt_shared_SUITE: await basic.get could have happened before the message was ready (cherry picked from commit e56c164)
1 parent 5cc0a53 commit b05b4aa

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

deps/rabbit/test/quorum_queue_SUITE.erl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,8 +2159,16 @@ grow_queue(Config) ->
21592159

21602160
%% grow queues to quorum cluster size > '5' (limit = 5).
21612161
TargetClusterSize_10 = 10,
2162-
Result5 = rpc:call(Server0, rabbit_quorum_queue, grow, [TargetClusterSize_10, <<"/">>, <<".*">>, all]),
2163-
?assert(lists:all(fun({_, {R, _}}) -> R =:= ok end, Result5)),
2162+
rabbit_ct_helpers:await_condition(
2163+
fun() ->
2164+
rpc:call(Server0, rabbit_quorum_queue, grow,
2165+
[TargetClusterSize_10, <<"/">>, <<".*">>, all]),
2166+
lists:all(
2167+
fun(Q) ->
2168+
{ok, Q0} = rpc:call(Server0, rabbit_amqqueue, lookup, [Q, <<"/">>]),
2169+
length(rabbit_queue_type:get_nodes(Q0)) =:= TargetClusterSize_5
2170+
end, QQs)
2171+
end, 30_000),
21642172
assert_grown_queues(QQs, Server0, TargetClusterSize_5, MsgCount),
21652173

21662174
%% shrink all queues again down to 1 member

deps/rabbitmq_mqtt/test/mqtt_shared_SUITE.erl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1698,10 +1698,10 @@ trace(Config) ->
16981698
<<"routed_queues">> := [<<"mqtt-subscription-trace_subscriberqos0">>]},
16991699
rabbit_misc:amqp_table(PublishHeaders)),
17001700

1701-
{#'basic.get_ok'{routing_key = <<"deliver.mqtt-subscription-trace_subscriberqos0">>},
1702-
#amqp_msg{props = #'P_basic'{headers = DeliverHeaders},
1703-
payload = Payload}} =
1704-
amqp_channel:call(Ch, #'basic.get'{queue = TraceQ}),
1701+
{_, #amqp_msg{props = #'P_basic'{headers = DeliverHeaders}, payload = Payload}} =
1702+
?awaitMatch({#'basic.get_ok'{routing_key = <<"deliver.mqtt-subscription-trace_subscriberqos0">>}, _},
1703+
amqp_channel:call(Ch, #'basic.get'{queue = TraceQ}),
1704+
5_000),
17051705
?assertMatch(#{<<"exchange_name">> := <<"amq.topic">>,
17061706
<<"routing_keys">> := [Topic],
17071707
<<"connection">> := <<"127.0.0.1:", _/binary>>,

0 commit comments

Comments
 (0)