fix(test): update the testcases

This commit is contained in:
Shawn 2021-07-15 15:38:47 +08:00
parent 3c47ab92d7
commit 6fbf20b930
3 changed files with 4 additions and 10 deletions

View File

@ -38,11 +38,11 @@
start() ->
foreach_listeners(fun start_listener/3).
-spec(start_listener(atom()) -> ok).
-spec start_listener(atom()) -> ok | {error, term()}.
start_listener(ListenerId) ->
apply_on_listener(ListenerId, fun start_listener/3).
-spec(start_listener(atom(), atom(), map()) -> ok).
-spec start_listener(atom(), atom(), map()) -> ok | {error, term()}.
start_listener(ZoneName, ListenerName, #{type := Type, bind := Bind} = Conf) ->
case do_start_listener(ZoneName, ListenerName, Conf) of
{ok, _} ->

View File

@ -32,8 +32,6 @@
, uptime/0
, datetime/0
, sysdescr/0
, sys_interval/0
, sys_heatbeat_interval/0
]).
-export([info/0]).
@ -104,13 +102,9 @@ datetime() ->
io_lib:format(
"~4..0w-~2..0w-~2..0w ~2..0w:~2..0w:~2..0w", [Y, M, D, H, MM, S])).
%% @doc Get sys interval
-spec(sys_interval() -> pos_integer()).
sys_interval() ->
emqx_config:get([broker, sys_msg_interval]).
%% @doc Get sys heatbeat interval
-spec(sys_heatbeat_interval() -> pos_integer()).
sys_heatbeat_interval() ->
emqx_config:get([broker, sys_heartbeat_interval]).

View File

@ -59,6 +59,8 @@ prop_sys() ->
do_setup() ->
ok = emqx_logger:set_log_level(emergency),
emqx_config:put([broker, sys_msg_interval], 60000),
emqx_config:put([broker, sys_msg_interval], 30000),
[mock(Mod) || Mod <- ?mock_modules],
ok.
@ -98,8 +100,6 @@ command(_State) ->
{call, emqx_sys, uptime, []},
{call, emqx_sys, datetime, []},
{call, emqx_sys, sysdescr, []},
{call, emqx_sys, sys_interval, []},
{call, emqx_sys, sys_heatbeat_interval, []},
%------------ unexpected message ----------------------%
{call, emqx_sys, handle_call, [emqx_sys, other, state]},
{call, emqx_sys, handle_cast, [emqx_sys, other]},