Skip to content

Commit 5531394

Browse files
the-mikedavismergify[bot]
authored andcommitted
cluster_minority_SUITE: Add a case for queue deletion
(cherry picked from commit a7d099d)
1 parent 53bc3c1 commit 5531394

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

deps/rabbit/test/cluster_minority_SUITE.erl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ groups() ->
2828
declare_binding,
2929
delete_binding,
3030
declare_queue,
31+
delete_queue,
3132
publish_to_exchange,
3233
publish_and_consume_to_local_classic_queue,
3334
consume_from_queue,
@@ -97,6 +98,16 @@ init_per_group(Group, Config0) when Group == client_operations;
9798
%% To be used in consume_from_queue
9899
#'queue.declare_ok'{} = amqp_channel:call(Ch, #'queue.declare'{queue = <<"test-queue">>,
99100
arguments = [{<<"x-queue-type">>, longstr, <<"classic">>}]}),
101+
%% To be used in consume_from_queue
102+
#'queue.declare_ok'{} = amqp_channel:call(Ch, #'queue.declare'{queue = <<"test-queue-delete-classic">>,
103+
durable = true,
104+
arguments = [{<<"x-queue-type">>, longstr, <<"classic">>}]}),
105+
#'queue.declare_ok'{} = amqp_channel:call(Ch, #'queue.declare'{queue = <<"test-queue-delete-stream">>,
106+
durable = true,
107+
arguments = [{<<"x-queue-type">>, longstr, <<"stream">>}]}),
108+
#'queue.declare_ok'{} = amqp_channel:call(Ch, #'queue.declare'{queue = <<"test-queue-delete-quorum">>,
109+
durable = true,
110+
arguments = [{<<"x-queue-type">>, longstr, <<"quorum">>}]}),
100111
%% To be used in delete_binding
101112
#'exchange.bind_ok'{} = amqp_channel:call(Ch, #'exchange.bind'{destination = <<"amq.fanout">>,
102113
source = <<"amq.direct">>,
@@ -188,6 +199,22 @@ declare_queue(Config) ->
188199
?assertExit({{shutdown, {connection_closing, {server_initiated_close, 541, _}}}, _},
189200
amqp_channel:call(Ch, #'queue.declare'{queue = <<"test-queue-2">>})).
190201

202+
delete_queue(Config) ->
203+
[A | _] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
204+
Conn1 = rabbit_ct_client_helpers:open_unmanaged_connection(Config, A),
205+
{ok, Ch1} = amqp_connection:open_channel(Conn1),
206+
?assertExit({{shutdown, {connection_closing, {server_initiated_close, 541, _}}}, _},
207+
amqp_channel:call(Ch1, #'queue.delete'{queue = <<"test-queue-delete-classic">>})),
208+
Conn2 = rabbit_ct_client_helpers:open_unmanaged_connection(Config, A),
209+
{ok, Ch2} = amqp_connection:open_channel(Conn2),
210+
?assertExit({{shutdown, {connection_closing, {server_initiated_close, 541, _}}}, _},
211+
amqp_channel:call(Ch2, #'queue.delete'{queue = <<"test-queue-delete-stream">>})),
212+
Conn3 = rabbit_ct_client_helpers:open_unmanaged_connection(Config, A),
213+
{ok, Ch3} = amqp_connection:open_channel(Conn3),
214+
?assertExit({{shutdown, {connection_closing, {server_initiated_close, 541, _}}}, _},
215+
amqp_channel:call(Ch3, #'queue.delete'{queue = <<"test-queue-delete-quorum">>})),
216+
ok.
217+
191218
publish_to_exchange(Config) ->
192219
[A | _] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
193220
{_, Ch} = rabbit_ct_client_helpers:open_connection_and_channel(Config, A),

0 commit comments

Comments
 (0)