test: fix flaky test emqx_falpping_SUITE:t_conf_update_timer
This commit is contained in:
parent
d1e5b69eac
commit
99b60849b4
|
@ -22,6 +22,9 @@
|
||||||
|
|
||||||
-export([init/1]).
|
-export([init/1]).
|
||||||
|
|
||||||
|
%% for test
|
||||||
|
-export([restart_flapping/0]).
|
||||||
|
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
%% API
|
%% API
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
@ -59,3 +62,8 @@ child_spec(Mod, Shutdown, Type) ->
|
||||||
type => Type,
|
type => Type,
|
||||||
modules => [Mod]
|
modules => [Mod]
|
||||||
}.
|
}.
|
||||||
|
|
||||||
|
restart_flapping() ->
|
||||||
|
ok = supervisor:terminate_child(?MODULE, emqx_flapping),
|
||||||
|
{ok, _} = supervisor:restart_child(?MODULE, emqx_flapping),
|
||||||
|
ok.
|
||||||
|
|
|
@ -133,7 +133,9 @@ t_conf_update(_) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
t_conf_update_timer(_Config) ->
|
t_conf_update_timer(_Config) ->
|
||||||
_ = emqx_flapping:start_link(),
|
%% delete all zones
|
||||||
|
?assertMatch({ok, _}, emqx:update_config([zones], #{})),
|
||||||
|
emqx_cm_sup:restart_flapping(),
|
||||||
validate_timer([{default, true}]),
|
validate_timer([{default, true}]),
|
||||||
%% change zones
|
%% change zones
|
||||||
{ok, _} =
|
{ok, _} =
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
-include_lib("emqx/include/emqx.hrl").
|
-include_lib("emqx/include/emqx.hrl").
|
||||||
-include("emqx_dashboard.hrl").
|
-include_lib("emqx_dashboard/include/emqx_dashboard.hrl").
|
||||||
|
|
||||||
-define(HOST, "http://127.0.0.1:18083").
|
-define(HOST, "http://127.0.0.1:18083").
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue