diff --git a/apps/emqx_gateway/src/emqx_gateway_conf.erl b/apps/emqx_gateway/src/emqx_gateway_conf.erl index 66323c53c..9e5893639 100644 --- a/apps/emqx_gateway/src/emqx_gateway_conf.erl +++ b/apps/emqx_gateway/src/emqx_gateway_conf.erl @@ -97,11 +97,11 @@ maps_key_take(Ks, M) -> maps_key_take(Ks, M, []). maps_key_take([], M, Acc) -> {lists:reverse(Acc), M}; -maps_key_take([K|Ks], M, Acc) -> +maps_key_take([K | Ks], M, Acc) -> case maps:take(K, M) of error -> throw(bad_key); {V, M1} -> - maps_key_take(Ks, M1, [V|Acc]) + maps_key_take(Ks, M1, [V | Acc]) end. -spec update_gateway(atom_or_bin(), map()) -> ok_or_err(). @@ -384,7 +384,7 @@ pre_config_update(UnknownReq, _RawConf) -> -> ok | {ok, Result::any()} | {error, Reason::term()}. post_config_update(Req, NewConfig, OldConfig, _AppEnvs) when is_tuple(Req) -> - [_Tag, GwName0|_] = tuple_to_list(Req), + [_Tag, GwName0 | _] = tuple_to_list(Req), GwName = binary_to_existing_atom(GwName0), case {maps:get(GwName, NewConfig, undefined), diff --git a/apps/emqx_machine/test/emqx_machine_SUITE.erl b/apps/emqx_machine/test/emqx_machine_SUITE.erl index cce0778e2..03d9e6ba9 100644 --- a/apps/emqx_machine/test/emqx_machine_SUITE.erl +++ b/apps/emqx_machine/test/emqx_machine_SUITE.erl @@ -26,6 +26,23 @@ all() -> emqx_common_test_helpers:all(?MODULE). init_per_suite(Config) -> + %% CASE-SIDE-EFFICT: + %% + %% Running-Seq: + %% emqx_authz_api_mnesia_SUITE.erl + %% emqx_gateway_api_SUITE.erl + %% emqx_machine_SUITE.erl + %% + %% Reason: + %% the `emqx_machine_boot:ensure_apps_started()` will crashed + %% on starting `emqx_authz` with dirty confs, which caused the file + %% `.._build/test/lib/emqx_conf/etc/acl.conf` could not be found + %% + %% Workaround: + %% Unload emqx_authz to avoid reboot this application + %% + application:unload(emqx_authz), + emqx_common_test_helpers:start_apps([]), Config.