Merge pull request #10903 from fix/ci-flaky-dashboard
test(dashboard): fix inter-suite test flakiness
This commit is contained in:
commit
aa98740280
|
@ -57,7 +57,6 @@
|
||||||
]).
|
]).
|
||||||
|
|
||||||
-export([pre_config_update/3, post_config_update/5]).
|
-export([pre_config_update/3, post_config_update/5]).
|
||||||
-export([wait_listener_stopped/1]).
|
|
||||||
|
|
||||||
-export([format_bind/1]).
|
-export([format_bind/1]).
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,6 @@ stop_listeners(Listeners) ->
|
||||||
begin
|
begin
|
||||||
case minirest:stop(Name) of
|
case minirest:stop(Name) of
|
||||||
ok ->
|
ok ->
|
||||||
_ = emqx_listeners:wait_listener_stopped(Bind),
|
|
||||||
?ULOG("Stop listener ~ts on ~ts successfully.~n", [
|
?ULOG("Stop listener ~ts on ~ts successfully.~n", [
|
||||||
Name, emqx_listeners:format_bind(Bind)
|
Name, emqx_listeners:format_bind(Bind)
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
-compile(export_all).
|
-compile(export_all).
|
||||||
|
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
-include("emqx_dashboard.hrl").
|
|
||||||
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
|
-include_lib("snabbkaffe/include/snabbkaffe.hrl").
|
||||||
|
|
||||||
-define(NAME, 'https:dashboard').
|
-define(NAME, 'https:dashboard').
|
||||||
|
|
|
@ -25,7 +25,6 @@ all() ->
|
||||||
emqx_common_test_helpers:all(?MODULE).
|
emqx_common_test_helpers:all(?MODULE).
|
||||||
|
|
||||||
init_per_suite(Config) ->
|
init_per_suite(Config) ->
|
||||||
emqx_common_test_helpers:load_config(emqx_dashboard_schema, <<"dashboard {}">>),
|
|
||||||
emqx_mgmt_api_test_util:init_suite([emqx_conf]),
|
emqx_mgmt_api_test_util:init_suite([emqx_conf]),
|
||||||
ok = change_i18n_lang(en),
|
ok = change_i18n_lang(en),
|
||||||
Config.
|
Config.
|
||||||
|
|
|
@ -30,24 +30,11 @@
|
||||||
all() -> emqx_common_test_helpers:all(?MODULE).
|
all() -> emqx_common_test_helpers:all(?MODULE).
|
||||||
|
|
||||||
init_per_suite(Config) ->
|
init_per_suite(Config) ->
|
||||||
mria:start(),
|
_ = emqx_mgmt_api_test_util:init_suite([emqx_conf]),
|
||||||
application:load(emqx_dashboard),
|
|
||||||
emqx_common_test_helpers:start_apps([emqx_conf, emqx_dashboard], fun set_special_configs/1),
|
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
set_special_configs(emqx_dashboard) ->
|
|
||||||
emqx_dashboard_api_test_helpers:set_default_config(),
|
|
||||||
ok;
|
|
||||||
set_special_configs(_) ->
|
|
||||||
ok.
|
|
||||||
|
|
||||||
end_per_suite(Config) ->
|
end_per_suite(Config) ->
|
||||||
end_suite(),
|
emqx_mgmt_api_test_util:end_suite([emqx_conf]).
|
||||||
Config.
|
|
||||||
|
|
||||||
end_suite() ->
|
|
||||||
application:unload(emqx_management),
|
|
||||||
emqx_common_test_helpers:stop_apps([emqx_dashboard]).
|
|
||||||
|
|
||||||
t_object(_Config) ->
|
t_object(_Config) ->
|
||||||
Spec = #{
|
Spec = #{
|
||||||
|
|
|
@ -30,7 +30,6 @@ init_suite(Apps, SetConfigs) when is_function(SetConfigs) ->
|
||||||
init_suite(Apps, SetConfigs, #{}).
|
init_suite(Apps, SetConfigs, #{}).
|
||||||
|
|
||||||
init_suite(Apps, SetConfigs, Opts) ->
|
init_suite(Apps, SetConfigs, Opts) ->
|
||||||
mria:start(),
|
|
||||||
application:load(emqx_management),
|
application:load(emqx_management),
|
||||||
emqx_common_test_helpers:start_apps(Apps ++ [emqx_dashboard], SetConfigs, Opts),
|
emqx_common_test_helpers:start_apps(Apps ++ [emqx_dashboard], SetConfigs, Opts),
|
||||||
emqx_common_test_http:create_default_app().
|
emqx_common_test_http:create_default_app().
|
||||||
|
@ -40,9 +39,8 @@ end_suite() ->
|
||||||
|
|
||||||
end_suite(Apps) ->
|
end_suite(Apps) ->
|
||||||
emqx_common_test_http:delete_default_app(),
|
emqx_common_test_http:delete_default_app(),
|
||||||
application:unload(emqx_management),
|
|
||||||
emqx_common_test_helpers:stop_apps(Apps ++ [emqx_dashboard]),
|
emqx_common_test_helpers:stop_apps(Apps ++ [emqx_dashboard]),
|
||||||
emqx_config:delete_override_conf_files(),
|
application:unload(emqx_management),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
set_special_configs(emqx_dashboard) ->
|
set_special_configs(emqx_dashboard) ->
|
||||||
|
|
Loading…
Reference in New Issue