From d7725f799c0950c0826bd6da862f32c66dc3af5f Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Tue, 23 Nov 2021 00:12:45 -0300 Subject: [PATCH] fix(flaky_test): improve live connection count test on CI (#6257) * fix(flaky_test): improve live connection count test on CI It seems that a race condition that is triggered more often in CI can make the test fail, possibly due to the ETS write not being seen by the subsequent read in the test. * style(elvis): fix NL in emqx_connector.conf --- apps/emqx/test/emqx_broker_SUITE.erl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/emqx/test/emqx_broker_SUITE.erl b/apps/emqx/test/emqx_broker_SUITE.erl index b1782da37..440e0fe42 100644 --- a/apps/emqx/test/emqx_broker_SUITE.erl +++ b/apps/emqx/test/emqx_broker_SUITE.erl @@ -479,6 +479,7 @@ t_connected_client_stats(Config) when is_list(Config) -> fun() -> emqtt:ConnFun(ConnPid) end, [emqx_cm_connected_client_count_inc] ), + timer:sleep(20), %% ensure stats are synchronized {_, {ok, [_]}} = wait_for_stats( fun emqx_cm:stats_fun/0, @@ -491,6 +492,7 @@ t_connected_client_stats(Config) when is_list(Config) -> fun() -> emqtt:disconnect(ConnPid) end, [emqx_cm_connected_client_count_dec] ), + timer:sleep(20), %% ensure stats are synchronized {_, {ok, [_]}} = wait_for_stats( fun emqx_cm:stats_fun/0,