Skip to content

Commit 2376e9b

Browse files
committed
fix rabbit_fifo SUITE
1 parent 46b6c2f commit 2376e9b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/rabbit_fifo_SUITE.erl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
-include_lib("common_test/include/ct.hrl").
66
-include_lib("eunit/include/eunit.hrl").
7+
-include_lib("rabbit_common/include/rabbit.hrl").
78

89
all() ->
910
[
@@ -57,8 +58,9 @@ init_per_testcase(TestCase, Config) ->
5758
ra_server_sup:remove_all(),
5859
ServerName2 = list_to_atom(atom_to_list(TestCase) ++ "2"),
5960
ServerName3 = list_to_atom(atom_to_list(TestCase) ++ "3"),
61+
ClusterName = rabbit_misc:r("/", queue, atom_to_binary(TestCase, utf8)),
6062
[
61-
{cluster_name, TestCase},
63+
{cluster_name, ClusterName},
6264
{uid, atom_to_binary(TestCase, utf8)},
6365
{node_id, {TestCase, node()}},
6466
{uid2, atom_to_binary(ServerName2, utf8)},
@@ -358,7 +360,7 @@ discard(Config) ->
358360
ServerId = ?config(node_id, Config),
359361
UId = ?config(uid, Config),
360362
ClusterName = ?config(cluster_name, Config),
361-
Conf = #{cluster_name => ClusterName,
363+
Conf = #{cluster_name => ClusterName#resource.name,
362364
id => ServerId,
363365
uid => UId,
364366
log_init_args => #{data_dir => PrivDir, uid => UId},
@@ -498,7 +500,7 @@ dead_letter_handler(Pid, Msgs) ->
498500
Pid ! {dead_letter, Msgs}.
499501

500502
dequeue(Config) ->
501-
ClusterName = ?config(priv_dir, Config),
503+
ClusterName = ?config(cluster_name, Config),
502504
ServerId = ?config(node_id, Config),
503505
UId = ?config(uid, Config),
504506
Tag = UId,
@@ -624,15 +626,15 @@ validate_process_down(Name, Num) ->
624626
end.
625627

626628
start_cluster(ClusterName, ServerIds, RaFifoConfig) ->
627-
{ok, Started, _} = ra:start_cluster(ClusterName,
629+
{ok, Started, _} = ra:start_cluster(ClusterName#resource.name,
628630
{module, rabbit_fifo, RaFifoConfig},
629631
ServerIds),
630632
?assertEqual(length(Started), length(ServerIds)),
631633
ok.
632634

633635
start_cluster(ClusterName, ServerIds) ->
634636
start_cluster(ClusterName, ServerIds, #{name => some_name,
635-
queue_resource => resource}).
637+
queue_resource => ClusterName}).
636638

637639
flush() ->
638640
receive

0 commit comments

Comments
 (0)