From 7c4842e6e59d86ad879bf6b1dc1d23ad90a4b46e Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Mon, 26 Sep 2022 08:57:53 -0300 Subject: [PATCH 1/2] test: attempt to fix inter-suite flakiness Ex: https://github.com/emqx/emqx-enterprise/actions/runs/3124750818/jobs/5068407612#step:7:769 ``` %%% undefined ==> end_per_suite: FAILED %%% undefined ==> {{badmatch,{error,enoent}}, [{emqx_auth_mongo_SUITE,end_per_suite,1, [{file,"/emqx/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl"}, {line,62}]}, {test_server,ts_tc,3,[{file,"test_server.erl"},{line,1784}]}, {test_server,run_test_case_eval1,6,[{file,"test_server.erl"},{line,1381}]}, {test_server,run_test_case_eval,9,[{file,"test_server.erl"},{line,1225}]}]} Testing lib.emqx_auth_mongo: TEST COMPLETE, 3 ok, 0 failed of 3 test cases ``` --- apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl index 1765b3821..77a11e213 100644 --- a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl @@ -115,7 +115,7 @@ init_per_suite(Config) -> end_per_suite(_Cfg) -> deinit_mongo_data(), %% avoid inter-suite flakiness - ok = emqx_mod_acl_internal:load([]), + emqx_mod_acl_internal:load([]), emqx_ct_helpers:stop_apps([emqx_auth_mongo]). set_special_confs(emqx) -> From a61c97ed9bfb647bebed42a4722b8081c1744fdc Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Mon, 26 Sep 2022 09:13:07 -0300 Subject: [PATCH 2/2] test: attempt to reduce inter-testcase flakiness in CI Ex: ``` === ERROR! init_per_testcase crashed! Location: [{emqx_auth_mongo_SUITE,'-init_mongo_data/0-fun-0-',207}, {emqx_auth_mongo_SUITE,init_mongo_data,207}, {emqx_auth_mongo_SUITE,init_per_testcase,177}, {test_server,do_init_per_testcase,1554}, {test_server,run_test_case_eval1,1255}, {test_server,run_test_case_eval,1225}] Reason: {{assertMatch,[{module,emqx_auth_mongo_SUITE}, {line,207}, {expression,"mongo_api : insert ( Connection , ? MONGO_CL_USER , ? INIT_AUTH )"}, {pattern,"{ { true , _ } , _ }"}, {value,{error,timeout}}]}, [{emqx_auth_mongo_SUITE,'-init_mongo_data/0-fun-0-',1, [{file,"/emqx/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl"}, {line,207}]}, {emqx_auth_mongo_SUITE,init_mongo_data,0, [{file,"/emqx/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl"}, {line,207}]}, {emqx_auth_mongo_SUITE,init_per_testcase,2, [{file,"/emqx/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl"}, {line,177}]}, {test_server,do_init_per_testcase,2,[{file,"test_server.erl"},{line,1554}]}, {test_server,run_test_case_eval1,6,[{file,"test_server.erl"},{line,1255}]}, {test_server,run_test_case_eval,9,[{file,"test_server.erl"},{line,1225}]}]} ``` --- apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl index 77a11e213..0031bc8c4 100644 --- a/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl +++ b/apps/emqx_auth_mongo/test/emqx_auth_mongo_SUITE.erl @@ -186,6 +186,8 @@ end_per_testcase(TestCase, Config) when TestCase =:= t_available_acl_query_timeout; TestCase =:= t_acl_superuser_timeout; TestCase =:= t_authn_no_connection; + TestCase =:= t_available_authn_query_timeout; + TestCase =:= t_authn_timeout; TestCase =:= t_available_acl_query_no_connection -> ProxyHost = ?config(proxy_host, Config), ProxyPort = ?config(proxy_port, Config),