summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Klishin <michael@novemberain.com>2018-03-06 23:07:50 +0300
committerGitHub <noreply@github.com>2018-03-06 23:07:50 +0300
commitcb77f6737304946b2a006274eb171901dd369a3f (patch)
treeacf2b5dd7a9fe05260c242fbb0492c057900c5cc /test
parent9b02e69ef5a6b7687e8bd0c7fbce9508bd1c6ee2 (diff)
parent5a0e47143b18b6ae52326ae40bb9b0b4f6ce1cd1 (diff)
downloadrabbitmq-server-git-cb77f6737304946b2a006274eb171901dd369a3f.tar.gz
Merge pull request #1542 from rabbitmq/master-locator-min-masters-group-bindings-3.7v3.7.4
Make min-masters locator count uniqueue queue names instead of bindings 3.7
Diffstat (limited to 'test')
-rw-r--r--test/queue_master_location_SUITE.erl28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/queue_master_location_SUITE.erl b/test/queue_master_location_SUITE.erl
index 457cf47b0c..94101567f6 100644
--- a/test/queue_master_location_SUITE.erl
+++ b/test/queue_master_location_SUITE.erl
@@ -56,6 +56,7 @@ groups() ->
declare_policy_exactly,
declare_config,
calculate_min_master,
+ calculate_min_master_with_bindings,
calculate_random,
calculate_client_local
]}
@@ -210,6 +211,22 @@ calculate_min_master(Config) ->
verify_min_master(Config, Q),
ok.
+calculate_min_master_with_bindings(Config) ->
+ setup_test_environment(Config),
+ QueueName = rabbit_misc:r(<<"/">>, queue, Q = <<"qm.test_bound">>),
+ Args = [{<<"x-queue-master-locator">>, longstr, <<"min-masters">>}],
+ declare(Config, QueueName, false, false, Args, none),
+ verify_min_master(Config, Q),
+ %% Add 20 bindings to this queue
+ [ bind(Config, QueueName, integer_to_binary(N)) || N <- lists:seq(1, 20) ],
+
+ QueueName1 = rabbit_misc:r(<<"/">>, queue, Q1 = <<"qm.test_unbound">>),
+ declare(Config, QueueName1, false, false, Args, none),
+ % Another queue should still be on the same node, bindings should
+ % not account for min-masters counting
+ verify_min_master(Config, Q1),
+ ok.
+
calculate_random(Config) ->
setup_test_environment(Config),
QueueName = rabbit_misc:r(<<"/">>, queue, Q = <<"qm.test">>),
@@ -314,6 +331,17 @@ declare(Config, QueueName, Durable, AutoDelete, Args0, Owner) ->
{new, Queue} = rabbit_ct_broker_helpers:rpc(Config, 0, rabbit_amqqueue, declare, Args1),
Queue.
+bind(Config, QueueName, RoutingKey) ->
+ ExchangeName = rabbit_misc:r(QueueName, exchange, <<"amq.direct">>),
+
+ ok = rabbit_ct_broker_helpers:rpc(
+ Config, 0, rabbit_binding, add,
+ [#binding{source = ExchangeName,
+ destination = QueueName,
+ key = RoutingKey,
+ args = []},
+ <<"acting-user">>]).
+
verify_min_master(Config, Q, MinMasterNode) ->
Rpc = rabbit_ct_broker_helpers:rpc(Config, 0,
rabbit_queue_master_location_misc,