Просмотр исходного кода

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

test(dashboard): fix inter-suite test flakiness
Andrew Mayorov 2 лет назад
Родитель
Сommit
aa98740280

+ 0 - 1
apps/emqx/src/emqx_listeners.erl

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

+ 0 - 1
apps/emqx_dashboard/src/emqx_dashboard.erl

@@ -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)
                     ]);

+ 0 - 1
apps/emqx_dashboard/test/emqx_dashboard_https_SUITE.erl

@@ -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').

+ 0 - 1
apps/emqx_dashboard/test/emqx_dashboard_listener_SUITE.erl

@@ -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.

+ 2 - 15
apps/emqx_dashboard/test/emqx_swagger_requestBody_SUITE.erl

@@ -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 = #{

+ 1 - 3
apps/emqx_management/test/emqx_mgmt_api_test_util.erl

@@ -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) ->