Skip to content

Commit fbf18f1

Browse files
committed
amqp_client_SUITE: Retry connection in two testcases
The testcases are `leader_transfer_credit` and `dead_letter_into_stream`.
1 parent cf82ce2 commit fbf18f1

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

deps/rabbit/test/amqp_client_SUITE.erl

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
-include_lib("eunit/include/eunit.hrl").
1212
-include_lib("amqp_client/include/amqp_client.hrl").
1313
-include_lib("amqp10_common/include/amqp10_framing.hrl").
14+
-include_lib("rabbitmq_ct_helpers/include/rabbit_assert.hrl").
1415

1516
-compile([nowarn_export_all,
1617
export_all]).
@@ -3912,11 +3913,14 @@ leader_transfer_credit(QName, QType, Credit, Config) ->
39123913
%% Create queue with leader on node 1.
39133914
{_, _, LinkPair1} = Init = init(1, Config),
39143915
try
3915-
{ok, #{type := QType}} = rabbitmq_amqp_client:declare_queue(
3916-
LinkPair1,
3917-
QName,
3918-
#{arguments => #{<<"x-queue-type">> => {utf8, QType},
3919-
<<"x-queue-leader-locator">> => {utf8, <<"client-local">>}}})
3916+
?awaitMatch(
3917+
{ok, #{type := QType}},
3918+
rabbitmq_amqp_client:declare_queue(
3919+
LinkPair1,
3920+
QName,
3921+
#{arguments => #{<<"x-queue-type">> => {utf8, QType},
3922+
<<"x-queue-leader-locator">> => {utf8, <<"client-local">>}}}),
3923+
60000)
39203924
after
39213925
ok = close(Init)
39223926
end,
@@ -5512,12 +5516,15 @@ dead_letter_into_stream(Config) ->
55125516
<<"x-dead-letter-exchange">> => {utf8, <<>>},
55135517
<<"x-dead-letter-routing-key">> => {utf8, QName1}
55145518
}}),
5515-
{ok, #{type := <<"stream">>}} = rabbitmq_amqp_client:declare_queue(
5516-
LinkPair1,
5517-
QName1,
5518-
#{arguments => #{<<"x-queue-type">> => {utf8, <<"stream">>},
5519-
<<"x-initial-cluster-size">> => {ulong, 1}
5520-
}}),
5519+
?awaitMatch(
5520+
{ok, #{type := <<"stream">>}},
5521+
rabbitmq_amqp_client:declare_queue(
5522+
LinkPair1,
5523+
QName1,
5524+
#{arguments => #{<<"x-queue-type">> => {utf8, <<"stream">>},
5525+
<<"x-initial-cluster-size">> => {ulong, 1}
5526+
}}),
5527+
60000),
55215528
{ok, Receiver} = amqp10_client:attach_receiver_link(
55225529
Session1, <<"receiver">>, <<"/amq/queue/", QName1/binary>>,
55235530
settled, configuration,

0 commit comments

Comments
 (0)