Skip to content

Commit 324debe

Browse files
committed
add a test case for mgmt API deletion of crashed queues
1 parent 1ce75c7 commit 324debe

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

deps/rabbitmq_management/test/rabbit_mgmt_http_SUITE.erl

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ all_tests() -> [
8383
multiple_invalid_connections_test,
8484
exchanges_test,
8585
queues_test,
86+
crashed_queues_test,
8687
quorum_queues_test,
8788
stream_queues_have_consumers_field,
8889
bindings_test,
@@ -1078,6 +1079,36 @@ queues_test(Config) ->
10781079
http_delete(Config, "/queues/downvhost/bar", {group, '2xx'}),
10791080
passed.
10801081

1082+
crashed_queues_test(Config) ->
1083+
Node = rabbit_ct_broker_helpers:get_node_config(Config, 0, nodename),
1084+
Q = #resource{virtual_host = <<"/">>, kind = queue, name = <<"crashingqueue">>},
1085+
1086+
QArgs = #{},
1087+
http_put(Config, "/queues/%2F/crashingqueue", QArgs, {group, '2xx'}),
1088+
1089+
ok = rabbit_ct_broker_helpers:rpc(Config, 0,
1090+
rabbit_amqqueue_control, await_state, [Node, Q, running]),
1091+
1092+
ok = rabbit_ct_broker_helpers:rpc(Config, 0,
1093+
rabbit_amqqueue, kill_queue_hard, [Node, Q]),
1094+
1095+
ok = rabbit_ct_broker_helpers:rpc(Config, 0,
1096+
rabbit_amqqueue_control, await_state, [Node, Q, crashed]),
1097+
1098+
CrashedQueue = http_get(Config, "/queues/%2F/crashingqueue"),
1099+
1100+
assert_item(#{name => <<"crashingqueue">>,
1101+
vhost => <<"/">>,
1102+
state => <<"crashed">>,
1103+
durable => false,
1104+
auto_delete => false,
1105+
exclusive => false,
1106+
arguments => #{}}, CrashedQueue),
1107+
1108+
http_delete(Config, "/queues/%2F/crashingqueue", {group, '2xx'}),
1109+
http_delete(Config, "/queues/%2F/crashingqueue", ?NOT_FOUND),
1110+
passed.
1111+
10811112
quorum_queues_test(Config) ->
10821113
%% Test in a loop that no metrics are left behing after deleting a queue
10831114
quorum_queues_test_loop(Config, 5).

0 commit comments

Comments
 (0)