diff --git a/lib-ce/emqx_modules/test/emqx_mod_sup_SUITE.erl b/lib-ce/emqx_modules/test/emqx_mod_sup_SUITE.erl index 230c5ab1d..cc60f3482 100644 --- a/lib-ce/emqx_modules/test/emqx_mod_sup_SUITE.erl +++ b/lib-ce/emqx_modules/test/emqx_mod_sup_SUITE.erl @@ -28,7 +28,6 @@ all() -> emqx_ct:all(?MODULE). %%-------------------------------------------------------------------- t_start(_) -> - {ok, _} = emqx_mod_sup:start_link(), ?assertEqual([], supervisor:which_children(emqx_mod_sup)). t_start_child(_) -> @@ -41,7 +40,6 @@ t_start_child(_) -> type => worker, modules => [Mod]}, - {ok, _} = emqx_mod_sup:start_link(), ok = emqx_mod_sup:start_child(Mod, worker), ?assertError({already_started, _}, emqx_mod_sup:start_child(Spec)), diff --git a/lib-ce/emqx_modules/test/emqx_modules_SUITE.erl b/lib-ce/emqx_modules/test/emqx_modules_SUITE.erl index cc4ea6662..d4976ff4c 100644 --- a/lib-ce/emqx_modules/test/emqx_modules_SUITE.erl +++ b/lib-ce/emqx_modules/test/emqx_modules_SUITE.erl @@ -127,6 +127,19 @@ t_modules_cmd(_) -> "Module emqx_mod_presence unloaded successfully.\n"), unmock_print(). +%% For: https://github.com/emqx/emqx/issues/4511 +t_join_cluster(_) -> + %% Started by emqx application + {error, {already_started, emqx_modules}} = application:start(emqx_modules), + %% After clustered + emqx:shutdown(), + emqx:reboot(), + {error,{already_started,emqx_modules}} = application:start(emqx_modules), + %% After emqx reboot, we should not interfere with other tests + _ = end_per_suite([]), + _ = init_per_suite([]), + ok. + mock_print() -> catch meck:unload(emqx_ctl), meck:new(emqx_ctl, [non_strict, passthrough]),