fix(mria): Fix startup sequence
This commit is contained in:
parent
887544c3c1
commit
69126fede6
|
@ -5,7 +5,7 @@
|
||||||
{vsn, "5.0.0"}, % strict semver, bump manually!
|
{vsn, "5.0.0"}, % strict semver, bump manually!
|
||||||
{modules, []},
|
{modules, []},
|
||||||
{registered, []},
|
{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,[]}},
|
{mod, {emqx_app,[]}},
|
||||||
{env, []},
|
{env, []},
|
||||||
{licenses, ["Apache-2.0"]},
|
{licenses, ["Apache-2.0"]},
|
||||||
|
|
|
@ -27,13 +27,11 @@ all() -> emqx_common_test_helpers:all(?MODULE).
|
||||||
init_per_suite(Config) ->
|
init_per_suite(Config) ->
|
||||||
application:load(emqx),
|
application:load(emqx),
|
||||||
ok = ekka:start(),
|
ok = ekka:start(),
|
||||||
%% for coverage
|
|
||||||
ok = emqx_banned:mnesia(copy),
|
|
||||||
Config.
|
Config.
|
||||||
|
|
||||||
end_per_suite(_Config) ->
|
end_per_suite(_Config) ->
|
||||||
ekka:stop(),
|
ekka:stop(),
|
||||||
mria:ensure_stopped(),
|
mria:stop(),
|
||||||
mria_mnesia:delete_schema().
|
mria_mnesia:delete_schema().
|
||||||
|
|
||||||
t_add_delete(_) ->
|
t_add_delete(_) ->
|
||||||
|
|
|
@ -195,7 +195,8 @@ generate_config(SchemaModule, ConfigFile) when is_atom(SchemaModule) ->
|
||||||
|
|
||||||
-spec(stop_apps(list()) -> ok).
|
-spec(stop_apps(list()) -> ok).
|
||||||
stop_apps(Apps) ->
|
stop_apps(Apps) ->
|
||||||
[application:stop(App) || App <- Apps ++ [emqx, mnesia]].
|
[application:stop(App) || App <- Apps ++ [emqx, mria, mnesia]],
|
||||||
|
ok.
|
||||||
|
|
||||||
%% backward compatible
|
%% backward compatible
|
||||||
deps_path(App, RelativePath) -> app_path(App, RelativePath).
|
deps_path(App, RelativePath) -> app_path(App, RelativePath).
|
||||||
|
|
|
@ -41,10 +41,6 @@ init_per_testcase(_TestCase, Config) ->
|
||||||
end_per_testcase(_TestCase, _Config) ->
|
end_per_testcase(_TestCase, _Config) ->
|
||||||
clear_tables().
|
clear_tables().
|
||||||
|
|
||||||
t_mnesia(_) ->
|
|
||||||
%% for coverage
|
|
||||||
ok = emqx_router:mnesia(copy).
|
|
||||||
|
|
||||||
% t_add_route(_) ->
|
% t_add_route(_) ->
|
||||||
% error('TODO').
|
% error('TODO').
|
||||||
|
|
||||||
|
@ -117,4 +113,3 @@ t_unexpected(_) ->
|
||||||
clear_tables() ->
|
clear_tables() ->
|
||||||
lists:foreach(fun mnesia:clear_table/1,
|
lists:foreach(fun mnesia:clear_table/1,
|
||||||
[emqx_route, emqx_trie, emqx_trie_node]).
|
[emqx_route, emqx_trie, emqx_trie_node]).
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ init_per_suite(Config) ->
|
||||||
|
|
||||||
end_per_suite(_Config) ->
|
end_per_suite(_Config) ->
|
||||||
ekka:stop(),
|
ekka:stop(),
|
||||||
mria:ensure_stopped(),
|
mria:stop(),
|
||||||
mria_mnesia:delete_schema().
|
mria_mnesia:delete_schema().
|
||||||
|
|
||||||
init_per_testcase(_TestCase, Config) ->
|
init_per_testcase(_TestCase, Config) ->
|
||||||
|
@ -60,9 +60,6 @@ init_per_testcase(_TestCase, Config) ->
|
||||||
end_per_testcase(_TestCase, _Config) ->
|
end_per_testcase(_TestCase, _Config) ->
|
||||||
clear_tables().
|
clear_tables().
|
||||||
|
|
||||||
t_mnesia(_) ->
|
|
||||||
ok = ?TRIE:mnesia(copy).
|
|
||||||
|
|
||||||
t_insert(_) ->
|
t_insert(_) ->
|
||||||
Fun = fun() ->
|
Fun = fun() ->
|
||||||
?TRIE:insert(<<"sensor/1/metric/2">>),
|
?TRIE:insert(<<"sensor/1/metric/2">>),
|
||||||
|
|
|
@ -50,7 +50,7 @@ init_per_suite(Config) ->
|
||||||
|
|
||||||
end_per_suite(_Config) ->
|
end_per_suite(_Config) ->
|
||||||
emqx_common_test_helpers:stop_apps([emqx_dashboard, emqx_management]),
|
emqx_common_test_helpers:stop_apps([emqx_dashboard, emqx_management]),
|
||||||
mria:ensure_stopped().
|
mria:stop().
|
||||||
|
|
||||||
set_special_configs(emqx_management) ->
|
set_special_configs(emqx_management) ->
|
||||||
emqx_config:put([emqx_management], #{listeners => [#{protocol => http, port => 8081}],
|
emqx_config:put([emqx_management], #{listeners => [#{protocol => http, port => 8081}],
|
||||||
|
|
|
@ -35,7 +35,6 @@ start() ->
|
||||||
ok = set_backtrace_depth(),
|
ok = set_backtrace_depth(),
|
||||||
ok = print_otp_version_warning(),
|
ok = print_otp_version_warning(),
|
||||||
ok = load_config_files(),
|
ok = load_config_files(),
|
||||||
mria:start(),
|
|
||||||
ekka:start(),
|
ekka:start(),
|
||||||
mria_rlog:wait_for_shards([?EMQX_MACHINE_SHARD], infinity),
|
mria_rlog:wait_for_shards([?EMQX_MACHINE_SHARD], infinity),
|
||||||
ok.
|
ok.
|
||||||
|
|
Loading…
Reference in New Issue