From ea6f2bd8d72e292d7337dabe6ae9bbc899d60eb9 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 3 Oct 2022 22:01:52 +0200 Subject: [PATCH] test: allow starting ct-slave without join cluster This is to test/inspect states before/after join --- test/emqx_node_helpers.erl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/emqx_node_helpers.erl b/test/emqx_node_helpers.erl index f7c048d51..ad530b3d7 100644 --- a/test/emqx_node_helpers.erl +++ b/test/emqx_node_helpers.erl @@ -18,6 +18,7 @@ -include_lib("eunit/include/eunit.hrl"). +%% modules is included because code is called before cluster join -define(SLAVE_START_APPS, [emqx, emqx_modules]). -export([start_slave/1, @@ -94,7 +95,12 @@ setup_node(Node, #{} = Opts) -> [ok = rpc:call(Node, application, load, [App]) || App <- [gen_rpc, emqx]], ok = rpc:call(Node, emqx_ct_helpers, start_apps, [StartApps, EnvHandler]), - ok = rpc:call(Node, ekka, join, [node()]), + case maps:get(no_join, Opts, false) of + true -> + ok; + false -> + ok = rpc:call(Node, ekka, join, [node()]) + end, %% Sanity check. Assert that `gen_rpc' is set up correctly: ?assertEqual( Node