summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuke Bakken <lbakken@pivotal.io>2020-03-05 19:52:43 +0000
committerLuke Bakken <lbakken@pivotal.io>2020-03-06 16:44:06 +0000
commit93179acf580a69eb3e4fd6f6f7412a6a8d85caa6 (patch)
treed995fc7fcaceca396a47793640638c676f3dbafd /test
parent4406d8eab7334f07d5caef9a61ca6412a54a6e4c (diff)
downloadrabbitmq-server-git-93179acf580a69eb3e4fd6f6f7412a6a8d85caa6.tar.gz
Add test that should fail
Add code to block multiple queue rebalance operations, fix test Allow acquiring the rebalance lock prior to calling rabbit_amqqueue:rebalance Simplify queue rebalance code to always acquire the lock using the current process
Diffstat (limited to 'test')
-rw-r--r--test/dynamic_ha_SUITE.erl25
1 files changed, 24 insertions, 1 deletions
diff --git a/test/dynamic_ha_SUITE.erl b/test/dynamic_ha_SUITE.erl
index 16a6dbd59a..1fc19a98f5 100644
--- a/test/dynamic_ha_SUITE.erl
+++ b/test/dynamic_ha_SUITE.erl
@@ -74,7 +74,8 @@ groups() ->
queue_survive_adding_dead_vhost_mirror,
rebalance_all,
rebalance_exactly,
- rebalance_nodes
+ rebalance_nodes,
+ rebalance_multiple_blocked
% FIXME: Re-enable those tests when the know issues are
% fixed.
% failing_random_policies,
@@ -691,6 +692,28 @@ rebalance_nodes(Config) ->
ok.
+rebalance_multiple_blocked(Config) ->
+ [A, _, _] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
+ ACh = rabbit_ct_client_helpers:open_channel(Config, A),
+ Q1 = <<"q1">>,
+ Q2 = <<"q2">>,
+ Q3 = <<"q3">>,
+ Q4 = <<"q4">>,
+ Q5 = <<"q5">>,
+ amqp_channel:call(ACh, #'queue.declare'{queue = Q1}),
+ amqp_channel:call(ACh, #'queue.declare'{queue = Q2}),
+ amqp_channel:call(ACh, #'queue.declare'{queue = Q3}),
+ amqp_channel:call(ACh, #'queue.declare'{queue = Q4}),
+ amqp_channel:call(ACh, #'queue.declare'{queue = Q5}),
+ ?assertEqual(A, node(proplists:get_value(pid, find_queue(Q1, A)))),
+ ?assertEqual(A, node(proplists:get_value(pid, find_queue(Q2, A)))),
+ ?assertEqual(A, node(proplists:get_value(pid, find_queue(Q3, A)))),
+ ?assertEqual(A, node(proplists:get_value(pid, find_queue(Q4, A)))),
+ ?assertEqual(A, node(proplists:get_value(pid, find_queue(Q5, A)))),
+ true = rpc:cast(A, rabbit_amqqueue, rebalance, [classic, ".*", ".*"]),
+ {error, rebalance_in_progress} = rpc:call(A, rabbit_amqqueue, rebalance, [classic, ".*", ".*"]),
+ ok.
+
%%----------------------------------------------------------------------------
assert_slaves(RPCNode, QName, Exp) ->