Skip to content

Commit afb162f

Browse files
Merge pull request #13652 from rabbitmq/mergify/bp/v4.0.x/pr-13651
Fix flake(s) in rabbit_fifo_int_SUITE (backport #13648) (backport #13651)
2 parents 5fad4b7 + 7322861 commit afb162f

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

deps/rabbit/test/amqpl_consumer_ack_SUITE.erl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ requeue_two_channels(QType, Config) ->
167167
QName = atom_to_binary(?FUNCTION_NAME),
168168
Ctag1 = <<"consumter tag 1">>,
169169
Ctag2 = <<"consumter tag 2">>,
170-
Ch1 = rabbit_ct_client_helpers:open_channel(Config),
171-
Ch2 = rabbit_ct_client_helpers:open_channel(Config),
170+
Conn = rabbit_ct_client_helpers:open_unmanaged_connection(Config, 0),
171+
{ok, Ch1} = amqp_connection:open_channel(Conn),
172+
{ok, Ch2} = amqp_connection:open_channel(Conn),
172173

173174
#'queue.declare_ok'{} = amqp_channel:call(
174175
Ch1,
@@ -225,7 +226,7 @@ requeue_two_channels(QType, Config) ->
225226
assert_messages(QName, 4, 4, Config),
226227

227228
%% Closing Ch1 should cause both messages to be requeued and delivered to the Ch2.
228-
ok = rabbit_ct_client_helpers:close_channel(Ch1),
229+
ok = amqp_channel:close(Ch1),
229230

230231
receive {#'basic.deliver'{consumer_tag = C5},
231232
#amqp_msg{payload = <<"1">>}} ->
@@ -247,7 +248,9 @@ requeue_two_channels(QType, Config) ->
247248
assert_messages(QName, 0, 0, Config),
248249

249250
?assertMatch(#'queue.delete_ok'{},
250-
amqp_channel:call(Ch2, #'queue.delete'{queue = QName})).
251+
amqp_channel:call(Ch2, #'queue.delete'{queue = QName})),
252+
amqp_connection:close(Conn),
253+
ok.
251254

252255
assert_messages(QNameBin, NumTotalMsgs, NumUnackedMsgs, Config) ->
253256
Vhost = ?config(rmq_vhost, Config),

deps/rabbit/test/rabbit_fifo_int_SUITE.erl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,19 @@ discard_next_delivery(ClusterName, State0, Wait) ->
938938
end.
939939

940940
start_cluster(ClusterName, ServerIds, RaFifoConfig) ->
941-
{ok, Started, _} = ra:start_cluster(?RA_SYSTEM,
942-
ClusterName#resource.name,
943-
{module, rabbit_fifo, RaFifoConfig},
944-
ServerIds),
941+
NameBin = ra_lib:to_binary(ClusterName#resource.name),
942+
Confs = [begin
943+
UId = ra:new_uid(NameBin),
944+
#{id => Id,
945+
uid => UId,
946+
cluster_name => ClusterName#resource.name,
947+
log_init_args => #{uid => UId},
948+
initial_members => ServerIds,
949+
initial_machine_version => rabbit_fifo:version(),
950+
machine => {module, rabbit_fifo, RaFifoConfig}}
951+
end
952+
|| Id <- ServerIds],
953+
{ok, Started, _} = ra:start_cluster(?RA_SYSTEM, Confs),
945954
?assertEqual(length(Started), length(ServerIds)),
946955
ok.
947956

0 commit comments

Comments
 (0)