diff options
| author | Diana Corbacho <diana@rabbitmq.com> | 2017-04-12 08:27:29 +0100 |
|---|---|---|
| committer | Diana Corbacho <diana@rabbitmq.com> | 2017-04-12 08:27:29 +0100 |
| commit | 186c32700b52de68cb3ba71e445844d236519603 (patch) | |
| tree | d78a17a4c39ba64fdaec653261a15064a19fa5ef /test | |
| parent | fe56987d5b8ccf6b8ad073f240c9bf8a330e532d (diff) | |
| download | rabbitmq-server-git-186c32700b52de68cb3ba71e445844d236519603.tar.gz | |
Re-enable disk_monitor in case of parser failures
Parser failures could be transient on start-up, so retry a few times
before giving up.
rabbitmq-server#1178
[#143558437]
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit_inbroker_non_parallel_SUITE.erl | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/unit_inbroker_non_parallel_SUITE.erl b/test/unit_inbroker_non_parallel_SUITE.erl index 266f0d30c0..68b7a15a8a 100644 --- a/test/unit_inbroker_non_parallel_SUITE.erl +++ b/test/unit_inbroker_non_parallel_SUITE.erl @@ -35,6 +35,7 @@ groups() -> app_management, %% Restart RabbitMQ. channel_statistics, %% Expect specific statistics. disk_monitor, %% Replace rabbit_misc module. + disk_monitor_enable, file_handle_cache, %% Change FHC limit. head_message_timestamp_statistics, %% Expect specific statistics. log_management, %% Check log files. @@ -744,6 +745,37 @@ disk_monitor1(_Config) -> meck:unload(rabbit_misc), passed. +disk_monitor_enable(Config) -> + passed = rabbit_ct_broker_helpers:rpc(Config, 0, + ?MODULE, disk_monitor_enable1, [Config]). + +disk_monitor_enable1(_Config) -> + case os:type() of + {unix, _} -> + disk_monitor_enable1(); + _ -> + %% skip windows testing + skipped + end. + +disk_monitor_enable1() -> + ok = meck:new(rabbit_misc, [passthrough]), + ok = meck:expect(rabbit_misc, os_cmd, fun(_) -> "\n" end), + application:set_env(rabbit, disk_monitor_enable_retries, 20000), + application:set_env(rabbit, disk_monitor_enable_interval, 100), + ok = rabbit_sup:stop_child(rabbit_disk_monitor_sup), + ok = rabbit_sup:start_delayed_restartable_child(rabbit_disk_monitor, [1000]), + undefined = rabbit_disk_monitor:get_disk_free(), + Cmd = "Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on\n/dev/disk1 975798272 234783364 740758908 25% 58759839 185189727 24% /\n", + ok = meck:expect(rabbit_misc, os_cmd, fun(_) -> Cmd end), + timer:sleep(1000), + Bytes = 740758908 * 1024, + Bytes = rabbit_disk_monitor:get_disk_free(), + meck:unload(rabbit_misc), + application:set_env(rabbit, disk_monitor_enable_retries, 10), + application:set_env(rabbit, disk_monitor_enable_interval, 120000), + passed. + %% --------------------------------------------------------------------------- %% rabbitmqctl helpers. %% --------------------------------------------------------------------------- |
