diff options
| author | kjnilsson <knilsson@pivotal.io> | 2019-03-01 10:53:58 +0000 |
|---|---|---|
| committer | kjnilsson <knilsson@pivotal.io> | 2019-03-01 10:53:58 +0000 |
| commit | ec7f0188e86e7588b0cd99a9744c2ebad33fa682 (patch) | |
| tree | a92983fa3cadbda87cd2308526a01af504bf6e2c | |
| parent | a19d77f20e312246767d8bfaa87529c2b546260b (diff) | |
| download | rabbitmq-server-git-ec7f0188e86e7588b0cd99a9744c2ebad33fa682.tar.gz | |
Tweak qourum queue tick interval for tests
As some tests use metrics to assert on and quorum queues only emit
metrics every 5s by default. This change takes it down to 1s for
selected suites.
It also introduces a new `quorum_tick_interval` application parameter to
set this interval.
| -rw-r--r-- | src/rabbit_quorum_queue.erl | 3 | ||||
| -rw-r--r-- | test/quorum_queue_SUITE.erl | 4 | ||||
| -rw-r--r-- | test/single_active_consumer_SUITE.erl | 8 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/rabbit_quorum_queue.erl b/src/rabbit_quorum_queue.erl index 28cfe9e558..c685785d0d 100644 --- a/src/rabbit_quorum_queue.erl +++ b/src/rabbit_quorum_queue.erl @@ -120,6 +120,7 @@ declare(Q) when ?amqqueue_is_quorum(Q) -> RaMachine = ra_machine(NewQ), ServerIds = [{RaName, Node} || Node <- Nodes], ClusterName = RaName, + TickTimeout = application:get_env(rabbit, quorum_tick_interval, ?TICK_TIMEOUT), RaConfs = [begin UId = ra:new_uid(ra_lib:to_binary(ClusterName)), FName = rabbit_misc:rs(QName), @@ -129,7 +130,7 @@ declare(Q) when ?amqqueue_is_quorum(Q) -> friendly_name => FName, initial_members => ServerIds, log_init_args => #{uid => UId}, - tick_timeout => ?TICK_TIMEOUT, + tick_timeout => TickTimeout, machine => RaMachine} end || ServerId <- ServerIds], diff --git a/test/quorum_queue_SUITE.erl b/test/quorum_queue_SUITE.erl index 0ec65c31b8..bab28ba1ff 100644 --- a/test/quorum_queue_SUITE.erl +++ b/test/quorum_queue_SUITE.erl @@ -126,8 +126,10 @@ memory_tests() -> %% Testsuite setup/teardown. %% ------------------------------------------------------------------- -init_per_suite(Config) -> +init_per_suite(Config0) -> rabbit_ct_helpers:log_environment(), + Config = rabbit_ct_helpers:merge_app_env( + Config0, {rabbit, [{quorum_tick_interval, 1000}]}), rabbit_ct_helpers:run_setup_steps( Config, [fun rabbit_ct_broker_helpers:enable_dist_proxy_manager/1]). diff --git a/test/single_active_consumer_SUITE.erl b/test/single_active_consumer_SUITE.erl index 0b12f54c0b..c22a13c744 100644 --- a/test/single_active_consumer_SUITE.erl +++ b/test/single_active_consumer_SUITE.erl @@ -45,12 +45,14 @@ groups() -> ]} ]. -init_per_suite(Config) -> +init_per_suite(Config0) -> rabbit_ct_helpers:log_environment(), - Config1 = rabbit_ct_helpers:set_config(Config, [ + Config1 = rabbit_ct_helpers:set_config(Config0, [ {rmq_nodename_suffix, ?MODULE} ]), - rabbit_ct_helpers:run_setup_steps(Config1, + Config = rabbit_ct_helpers:merge_app_env( + Config1, {rabbit, [{quorum_tick_interval, 1000}]}), + rabbit_ct_helpers:run_setup_steps(Config, rabbit_ct_broker_helpers:setup_steps() ++ rabbit_ct_client_helpers:setup_steps()). |
