From 599121052acdc3b24e74877dfba3fc572f4ee1f2 Mon Sep 17 00:00:00 2001 From: Gilbert Wong Date: Thu, 18 Oct 2018 10:41:01 +0800 Subject: [PATCH] Add test case for init_proc_mng_policy --- test/emqx_misc_SUITE.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/emqx_misc_SUITE.erl b/test/emqx_misc_SUITE.erl index 766691869..87f51746a 100644 --- a/test/emqx_misc_SUITE.erl +++ b/test/emqx_misc_SUITE.erl @@ -25,7 +25,7 @@ {backlog, 512}, {nodelay, true}]). -all() -> [t_merge_opts]. +all() -> [t_merge_opts, t_init_proc_mng_policy]. t_merge_opts(_) -> Opts = emqx_misc:merge_opts(?SOCKOPTS, [raw, @@ -43,3 +43,10 @@ t_merge_opts(_) -> {nodelay, false}, {packet, raw}, {reuseaddr, true}] = lists:sort(Opts). + +t_init_proc_mng_policy(_) -> + application:set_env(emqx, zones, [{policy, [{force_shutdown_policy, #{max_heap_size => 1}}]}]), + {ok, _} = emqx_zone:start_link(), + ok = emqx_misc:init_proc_mng_policy(policy), + ok = emqx_misc:init_proc_mng_policy(undefined), + emqx_zone:stop().