Add test case for init_proc_mng_policy

This commit is contained in:
Gilbert Wong 2018-10-18 10:41:01 +08:00
parent c890792613
commit 599121052a
1 changed files with 8 additions and 1 deletions

View File

@ -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().