Merge pull request #10903 from fix/ci-flaky-dashboard

test(dashboard): fix inter-suite test flakiness
This commit is contained in:
Andrew Mayorov 2023-05-31 20:28:39 +03:00 committed by GitHub
commit aa98740280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 3 additions and 22 deletions

View File

@ -57,7 +57,6 @@
]).
-export([pre_config_update/3, post_config_update/5]).
-export([wait_listener_stopped/1]).
-export([format_bind/1]).

View File

@ -111,7 +111,6 @@ stop_listeners(Listeners) ->
begin
case minirest:stop(Name) of
ok ->
_ = emqx_listeners:wait_listener_stopped(Bind),
?ULOG("Stop listener ~ts on ~ts successfully.~n", [
Name, emqx_listeners:format_bind(Bind)
]);

View File

@ -20,7 +20,6 @@
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
-include("emqx_dashboard.hrl").
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
-define(NAME, 'https:dashboard').

View File

@ -25,7 +25,6 @@ all() ->
emqx_common_test_helpers:all(?MODULE).
init_per_suite(Config) ->
emqx_common_test_helpers:load_config(emqx_dashboard_schema, <<"dashboard {}">>),
emqx_mgmt_api_test_util:init_suite([emqx_conf]),
ok = change_i18n_lang(en),
Config.

View File

@ -30,24 +30,11 @@
all() -> emqx_common_test_helpers:all(?MODULE).
init_per_suite(Config) ->
mria:start(),
application:load(emqx_dashboard),
emqx_common_test_helpers:start_apps([emqx_conf, emqx_dashboard], fun set_special_configs/1),
_ = emqx_mgmt_api_test_util:init_suite([emqx_conf]),
Config.
set_special_configs(emqx_dashboard) ->
emqx_dashboard_api_test_helpers:set_default_config(),
ok;
set_special_configs(_) ->
ok.
end_per_suite(Config) ->
end_suite(),
Config.
end_suite() ->
application:unload(emqx_management),
emqx_common_test_helpers:stop_apps([emqx_dashboard]).
emqx_mgmt_api_test_util:end_suite([emqx_conf]).
t_object(_Config) ->
Spec = #{

View File

@ -30,7 +30,6 @@ init_suite(Apps, SetConfigs) when is_function(SetConfigs) ->
init_suite(Apps, SetConfigs, #{}).
init_suite(Apps, SetConfigs, Opts) ->
mria:start(),
application:load(emqx_management),
emqx_common_test_helpers:start_apps(Apps ++ [emqx_dashboard], SetConfigs, Opts),
emqx_common_test_http:create_default_app().
@ -40,9 +39,8 @@ end_suite() ->
end_suite(Apps) ->
emqx_common_test_http:delete_default_app(),
application:unload(emqx_management),
emqx_common_test_helpers:stop_apps(Apps ++ [emqx_dashboard]),
emqx_config:delete_override_conf_files(),
application:unload(emqx_management),
ok.
set_special_configs(emqx_dashboard) ->