summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/backing_queue_SUITE.erl18
1 files changed, 17 insertions, 1 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]).