fix(emqx): avoid interference in testsuites
Also remove that `?wait_async_action` in `emqx_trace_SUITE` which consistently becomes stuck for 100 seconds. It's not clear why it was there in the first place because listeners should start synchronously, so `emqx_common_test_helpers:start_apps/1` won't return until required listeners are started.
This commit is contained in:
parent
8a31e5639b
commit
206d0472e0
|
@ -347,6 +347,7 @@ stop_apps(Apps, Opts) ->
|
||||||
ok = mria_mnesia:delete_schema(),
|
ok = mria_mnesia:delete_schema(),
|
||||||
%% to avoid inter-suite flakiness
|
%% to avoid inter-suite flakiness
|
||||||
application:unset_env(emqx, init_config_load_done),
|
application:unset_env(emqx, init_config_load_done),
|
||||||
|
application:unset_env(emqx, boot_modules),
|
||||||
persistent_term:erase(?EMQX_AUTHENTICATION_SCHEMA_MODULE_PT_KEY),
|
persistent_term:erase(?EMQX_AUTHENTICATION_SCHEMA_MODULE_PT_KEY),
|
||||||
case Opts of
|
case Opts of
|
||||||
#{erase_all_configs := false} ->
|
#{erase_all_configs := false} ->
|
||||||
|
|
|
@ -326,8 +326,7 @@ t_gc_active(_Config) ->
|
||||||
emqx_tls_certfile_gc:run()
|
emqx_tls_certfile_gc:run()
|
||||||
)
|
)
|
||||||
after
|
after
|
||||||
emqx_common_test_helpers:stop_apps([]),
|
emqx_common_test_helpers:stop_apps([])
|
||||||
emqx_common_test_helpers:boot_modules(all)
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
orphans() ->
|
orphans() ->
|
||||||
|
|
|
@ -33,21 +33,12 @@ all() ->
|
||||||
emqx_common_test_helpers:all(?MODULE).
|
emqx_common_test_helpers:all(?MODULE).
|
||||||
|
|
||||||
init_per_suite(Config) ->
|
init_per_suite(Config) ->
|
||||||
%% ensure dependent apps stopped
|
ok = emqx_common_test_helpers:start_apps([]),
|
||||||
emqx_common_test_helpers:stop_apps([]),
|
Listeners = emqx_listeners:list(),
|
||||||
?check_trace(
|
ct:pal("emqx_listeners:list() = ~p~n", [Listeners]),
|
||||||
?wait_async_action(
|
?assertMatch(
|
||||||
emqx_common_test_helpers:start_apps([]),
|
[_ | _],
|
||||||
#{?snk_kind := listener_started, bind := 1883},
|
[ID || {ID, #{running := true}} <- Listeners]
|
||||||
timer:seconds(100)
|
|
||||||
),
|
|
||||||
fun(Trace) ->
|
|
||||||
ct:pal("listener start statuses: ~p", [
|
|
||||||
?of_kind([listener_started, listener_not_started], Trace)
|
|
||||||
]),
|
|
||||||
%% more than one listener
|
|
||||||
?assertMatch([_ | _], ?of_kind(listener_started, Trace))
|
|
||||||
end
|
|
||||||
),
|
),
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue