summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2019-01-25 13:34:39 +0300
committerMichael Klishin <mklishin@pivotal.io>2019-01-25 13:34:39 +0300
commit16f49718518ef14f72b32981a210723e7ea057aa (patch)
tree28df886e24ca1ebeacf851a2183ef002d2830f67 /test
parent944ba28d32e5a607b99b599c1704dadedace8e21 (diff)
parentf1bb0e1caacec32a0807ed1961c74dc78c0ecae1 (diff)
downloadrabbitmq-server-git-16f49718518ef14f72b32981a210723e7ea057aa.tar.gz
Merge branch 'master' into qq-queue-length-drop-head
Diffstat (limited to 'test')
-rw-r--r--test/backing_queue_SUITE.erl18
-rw-r--r--test/dynamic_qq_SUITE.erl1
2 files changed, 17 insertions, 2 deletions
diff --git a/test/backing_queue_SUITE.erl b/test/backing_queue_SUITE.erl
index 5864c387c5..433bc66bff 100644
--- a/test/backing_queue_SUITE.erl
+++ b/test/backing_queue_SUITE.erl
@@ -723,7 +723,7 @@ bq_queue_recover1(Config) ->
true, false, [], none, <<"acting-user">>),
publish_and_confirm(Q, <<>>, Count),
- SupPid = rabbit_ct_broker_helpers:get_queue_sup_pid(Q),
+ SupPid = get_queue_sup_pid(Q),
true = is_pid(SupPid),
exit(SupPid, kill),
exit(QPid, kill),
@@ -751,6 +751,22 @@ bq_queue_recover1(Config) ->
end),
passed.
+%% Return the PID of the given queue's supervisor.
+get_queue_sup_pid(#amqqueue { pid = QPid, name = QName }) ->
+ VHost = QName#resource.virtual_host,
+ {ok, AmqSup} = rabbit_amqqueue_sup_sup:find_for_vhost(VHost, node(QPid)),
+ Sups = supervisor:which_children(AmqSup),
+ get_queue_sup_pid(Sups, QPid).
+
+get_queue_sup_pid([{_, SupPid, _, _} | Rest], QueuePid) ->
+ WorkerPids = [Pid || {_, Pid, _, _} <- supervisor:which_children(SupPid)],
+ case lists:member(QueuePid, WorkerPids) of
+ true -> SupPid;
+ false -> get_queue_sup_pid(Rest, QueuePid)
+ end;
+get_queue_sup_pid([], _QueuePid) ->
+ undefined.
+
variable_queue_dynamic_duration_change(Config) ->
passed = rabbit_ct_broker_helpers:rpc(Config, 0,
?MODULE, variable_queue_dynamic_duration_change1, [Config]).
diff --git a/test/dynamic_qq_SUITE.erl b/test/dynamic_qq_SUITE.erl
index 3357e6f74b..fbc1e81827 100644
--- a/test/dynamic_qq_SUITE.erl
+++ b/test/dynamic_qq_SUITE.erl
@@ -133,7 +133,6 @@ force_delete_if_no_consensus(Config) ->
arguments = Args,
durable = true,
passive = true})),
- %% TODO implement a force delete
BCh2 = rabbit_ct_client_helpers:open_channel(Config, B),
?assertMatch(#'queue.delete_ok'{},
amqp_channel:call(BCh2, #'queue.delete'{queue = QName})),