diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2016-09-20 02:16:37 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2016-09-20 02:16:37 +0300 |
| commit | 256d17114db77527601a0dd9611423a45eb3e0cd (patch) | |
| tree | 0a58396aa6f95d0e1aa13f73a140d2812ce287dd | |
| parent | 97bfbf6b999923b0183a11fc37eff2ce0d8a4b9d (diff) | |
| download | rabbitmq-server-git-256d17114db77527601a0dd9611423a45eb3e0cd.tar.gz | |
One more test
| -rw-r--r-- | test/per_vhost_queue_limit_SUITE.erl | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/test/per_vhost_queue_limit_SUITE.erl b/test/per_vhost_queue_limit_SUITE.erl index 4055807037..effd36ff53 100644 --- a/test/per_vhost_queue_limit_SUITE.erl +++ b/test/per_vhost_queue_limit_SUITE.erl @@ -40,7 +40,8 @@ groups() -> single_node_single_vhost_limit, single_node_single_vhost_zero_limit, single_node_single_vhost_limit_with_durable_named_queue, - single_node_single_vhost_zero_limit_with_durable_named_queue + single_node_single_vhost_zero_limit_with_durable_named_queue, + single_node_single_vhost_limit_with_queue_ttl ]}, {cluster_size_2, [], [ most_basic_cluster_queue_count, @@ -283,6 +284,42 @@ single_node_single_vhost_zero_limit_with(Config, QueueDeclare) -> rabbit_ct_broker_helpers:delete_vhost(Config, VHost). +single_node_single_vhost_limit_with_queue_ttl(Config) -> + VHost = <<"queue-limits">>, + set_up_vhost(Config, VHost), + ?assertEqual(0, count_queues_in(Config, VHost)), + + Conn1 = open_unmanaged_connection(Config, 0, VHost), + {ok, Ch1} = amqp_connection:open_channel(Conn1), + + set_vhost_queue_limit(Config, VHost, 3), + + lists:foreach(fun (_) -> + #'queue.declare_ok'{queue = _} = + amqp_channel:call(Ch1, #'queue.declare'{queue = <<"">>, + exclusive = true, + arguments = [{<<"x-expires">>, long, 2000}]}) + end, lists:seq(1, 3)), + + + expect_shutdown_due_to_precondition_failed( + fun () -> + amqp_channel:call(Ch1, #'queue.declare'{queue = <<"">>, + exclusive = true}) + end), + + Conn2 = open_unmanaged_connection(Config, 0, VHost), + {ok, Ch2} = amqp_connection:open_channel(Conn2), + + %% wait for the queues to expire + timer:sleep(3000), + + #'queue.declare_ok'{queue = _} = + amqp_channel:call(Ch2, #'queue.declare'{queue = <<"">>, + exclusive = true}), + + rabbit_ct_broker_helpers:delete_vhost(Config, VHost). + most_basic_cluster_queue_count(Config) -> VHost = <<"queue-limits">>, |
