test: fix flaky gateway tests

This commit is contained in:
Thales Macedo Garitezi 2022-08-04 11:56:19 -03:00
parent 7e6b94fc12
commit d2e146aeff
2 changed files with 4 additions and 2 deletions

View File

@ -143,7 +143,9 @@ on_start_auth(authn_http) ->
Setup = fun(Gateway) -> Setup = fun(Gateway) ->
Path = io_lib:format("/gateway/~ts/authentication", [Gateway]), Path = io_lib:format("/gateway/~ts/authentication", [Gateway]),
{204, _} = request(delete, Path), {204, _} = request(delete, Path),
{201, _} = request(post, Path, http_authn_config()) timer:sleep(200),
{201, _} = request(post, Path, http_authn_config()),
timer:sleep(200)
end, end,
lists:foreach(Setup, ?GATEWAYS), lists:foreach(Setup, ?GATEWAYS),

View File

@ -103,7 +103,7 @@ init_per_suite(Config) ->
end_per_suite(_) -> end_per_suite(_) ->
{ok, _} = emqx:remove_config([gateway, mqttsn]), {ok, _} = emqx:remove_config([gateway, mqttsn]),
emqx_mgmt_api_test_util:end_suite([emqx_gateway, emqx_auhtn, emqx_conf]). emqx_mgmt_api_test_util:end_suite([emqx_gateway, emqx_authn, emqx_conf]).
restart_mqttsn_with_subs_resume_on() -> restart_mqttsn_with_subs_resume_on() ->
Conf = emqx:get_raw_config([gateway, mqttsn]), Conf = emqx:get_raw_config([gateway, mqttsn]),