test(mqtt-bridge): do not assert map key order

starting from otp 26, small maps (less than 32 fields), the atom
key orders are no longer deterministic
This commit is contained in:
Zaiming (Stone) Shi 2023-12-12 16:45:34 +01:00
parent 077412fccd
commit 9487635957
1 changed files with 6 additions and 7 deletions

View File

@ -230,19 +230,18 @@ t_conf_bridge_authn_passfile(Config) ->
?assertReceive( ?assertReceive(
{authenticate, #{username := Username2, password := Password2}} {authenticate, #{username := Username2, password := Password2}}
), ),
?assertMatch( {ok, 201, #{
{ok, 201, #{ <<"status">> := <<"disconnected">>,
<<"status">> := <<"disconnected">>, <<"status_reason">> := Reason
<<"status_reason">> := <<"#{msg => failed_to_read_secret_file", _/bytes>> }} =
}},
request_json( request_json(
post, post,
uri(["bridges"]), uri(["bridges"]),
?SERVER_CONF(<<>>, <<"file://im/pretty/sure/theres/no/such/file">>)#{ ?SERVER_CONF(<<>>, <<"file://im/pretty/sure/theres/no/such/file">>)#{
<<"name">> => <<"t_conf_bridge_authn_no_passfile">> <<"name">> => <<"t_conf_bridge_authn_no_passfile">>
} }
) ),
). ?assertMatch({match, _}, re:run(Reason, <<"failed_to_read_secret_file">>)).
hook_authenticate() -> hook_authenticate() ->
emqx_hooks:add('client.authenticate', {?MODULE, authenticate, [self()]}, ?HP_HIGHEST). emqx_hooks:add('client.authenticate', {?MODULE, authenticate, [self()]}, ?HP_HIGHEST).