From 351a3e80a41194df07c4ec3692a431ae4f6eb9c5 Mon Sep 17 00:00:00 2001 From: Michal Kuratczyk Date: Mon, 13 Sep 2021 12:08:02 +0200 Subject: Only consider configured nodes, if defined Queue args/policy can explicitly define the nodes for a queue. Previously this was ignored and all cluster nodes were considred. Also, wait for metrics to be emitted before the assertion. --- deps/rabbit/src/rabbit_queue_location_min_masters.erl | 2 +- deps/rabbit/test/queue_master_location_SUITE.erl | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/deps/rabbit/src/rabbit_queue_location_min_masters.erl b/deps/rabbit/src/rabbit_queue_location_min_masters.erl index fd2f9bdf65..847a74fb94 100644 --- a/deps/rabbit/src/rabbit_queue_location_min_masters.erl +++ b/deps/rabbit/src/rabbit_queue_location_min_masters.erl @@ -40,7 +40,7 @@ description() -> ]. queue_master_location(Q) when ?is_amqqueue(Q) -> - Nodes0 = rabbit_nodes:all_running(), + Nodes0 = rabbit_queue_master_location_misc:all_nodes(Q), Nodes = rabbit_maintenance:filter_out_drained_nodes_local_read(Nodes0), case Nodes of [] -> diff --git a/deps/rabbit/test/queue_master_location_SUITE.erl b/deps/rabbit/test/queue_master_location_SUITE.erl index a4801b2e13..266db064d2 100644 --- a/deps/rabbit/test/queue_master_location_SUITE.erl +++ b/deps/rabbit/test/queue_master_location_SUITE.erl @@ -189,6 +189,11 @@ declare_policy_nodes(Config) -> ok = rabbit_ct_broker_helpers:set_policy(Config, 0, ?POLICY, <<".*">>, <<"queues">>, Policy), QueueName = rabbit_misc:r(<<"/">>, queue, Q = <<"qm.test">>), + + rabbit_ct_helpers:await_condition(fun() -> + 0 < ets:info(queue_metrics, size) + end, 60000), + declare(Config, QueueName, false, false, _Args=[], none), verify_min_master(Config, Q, Node1). -- cgit v1.2.1