From d2e146aeffbf117655172c83a0556740c81e4706 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Thu, 4 Aug 2022 11:56:19 -0300 Subject: [PATCH] test: fix flaky gateway tests --- apps/emqx_gateway/test/emqx_gateway_auth_ct.erl | 4 +++- apps/emqx_gateway/test/emqx_sn_protocol_SUITE.erl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/emqx_gateway/test/emqx_gateway_auth_ct.erl b/apps/emqx_gateway/test/emqx_gateway_auth_ct.erl index 16d033d41..e24764030 100644 --- a/apps/emqx_gateway/test/emqx_gateway_auth_ct.erl +++ b/apps/emqx_gateway/test/emqx_gateway_auth_ct.erl @@ -143,7 +143,9 @@ on_start_auth(authn_http) -> Setup = fun(Gateway) -> Path = io_lib:format("/gateway/~ts/authentication", [Gateway]), {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, lists:foreach(Setup, ?GATEWAYS), diff --git a/apps/emqx_gateway/test/emqx_sn_protocol_SUITE.erl b/apps/emqx_gateway/test/emqx_sn_protocol_SUITE.erl index 54928a792..084fd9f57 100644 --- a/apps/emqx_gateway/test/emqx_sn_protocol_SUITE.erl +++ b/apps/emqx_gateway/test/emqx_sn_protocol_SUITE.erl @@ -103,7 +103,7 @@ init_per_suite(Config) -> end_per_suite(_) -> {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() -> Conf = emqx:get_raw_config([gateway, mqttsn]),