fix(mria): Fix startup sequence

This commit is contained in:
k32 2021-10-18 11:42:00 +02:00 committed by x1001100011
parent 887544c3c1
commit 69126fede6
7 changed files with 6 additions and 16 deletions

View File

@ -5,7 +5,7 @@
{vsn, "5.0.0"}, % strict semver, bump manually!
{modules, []},
{registered, []},
{applications, [kernel,stdlib,gproc,gen_rpc,esockd,cowboy,sasl,os_mon,jiffy,lc]},
{applications, [kernel,stdlib,gproc,gen_rpc,mria,esockd,cowboy,sasl,os_mon,jiffy,lc]},
{mod, {emqx_app,[]}},
{env, []},
{licenses, ["Apache-2.0"]},

View File

@ -27,13 +27,11 @@ all() -> emqx_common_test_helpers:all(?MODULE).
init_per_suite(Config) ->
application:load(emqx),
ok = ekka:start(),
%% for coverage
ok = emqx_banned:mnesia(copy),
Config.
end_per_suite(_Config) ->
ekka:stop(),
mria:ensure_stopped(),
mria:stop(),
mria_mnesia:delete_schema().
t_add_delete(_) ->

View File

@ -195,7 +195,8 @@ generate_config(SchemaModule, ConfigFile) when is_atom(SchemaModule) ->
-spec(stop_apps(list()) -> ok).
stop_apps(Apps) ->
[application:stop(App) || App <- Apps ++ [emqx, mnesia]].
[application:stop(App) || App <- Apps ++ [emqx, mria, mnesia]],
ok.
%% backward compatible
deps_path(App, RelativePath) -> app_path(App, RelativePath).

View File

@ -41,10 +41,6 @@ init_per_testcase(_TestCase, Config) ->
end_per_testcase(_TestCase, _Config) ->
clear_tables().
t_mnesia(_) ->
%% for coverage
ok = emqx_router:mnesia(copy).
% t_add_route(_) ->
% error('TODO').
@ -117,4 +113,3 @@ t_unexpected(_) ->
clear_tables() ->
lists:foreach(fun mnesia:clear_table/1,
[emqx_route, emqx_trie, emqx_trie_node]).

View File

@ -50,7 +50,7 @@ init_per_suite(Config) ->
end_per_suite(_Config) ->
ekka:stop(),
mria:ensure_stopped(),
mria:stop(),
mria_mnesia:delete_schema().
init_per_testcase(_TestCase, Config) ->
@ -60,9 +60,6 @@ init_per_testcase(_TestCase, Config) ->
end_per_testcase(_TestCase, _Config) ->
clear_tables().
t_mnesia(_) ->
ok = ?TRIE:mnesia(copy).
t_insert(_) ->
Fun = fun() ->
?TRIE:insert(<<"sensor/1/metric/2">>),

View File

@ -50,7 +50,7 @@ init_per_suite(Config) ->
end_per_suite(_Config) ->
emqx_common_test_helpers:stop_apps([emqx_dashboard, emqx_management]),
mria:ensure_stopped().
mria:stop().
set_special_configs(emqx_management) ->
emqx_config:put([emqx_management], #{listeners => [#{protocol => http, port => 8081}],

View File

@ -35,7 +35,6 @@ start() ->
ok = set_backtrace_depth(),
ok = print_otp_version_warning(),
ok = load_config_files(),
mria:start(),
ekka:start(),
mria_rlog:wait_for_shards([?EMQX_MACHINE_SHARD], infinity),
ok.