From 5c112602b8e48439f1e229c924f9667930524043 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Fri, 19 May 2023 13:37:36 +0300 Subject: [PATCH] test(evict): fix flapping testcase Postpone enabling eviction agent so that target connection will not get evicted too early. --- apps/emqx_eviction_agent/test/emqx_eviction_agent_SUITE.erl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/emqx_eviction_agent/test/emqx_eviction_agent_SUITE.erl b/apps/emqx_eviction_agent/test/emqx_eviction_agent_SUITE.erl index 22b694d77..a68a1f292 100644 --- a/apps/emqx_eviction_agent/test/emqx_eviction_agent_SUITE.erl +++ b/apps/emqx_eviction_agent/test/emqx_eviction_agent_SUITE.erl @@ -159,8 +159,6 @@ t_explicit_session_takeover(Config) -> ]), {ok, _, _} = emqtt:subscribe(C0, <<"t1">>), - ok = rpc:call(Node1, emqx_eviction_agent, enable, [test_eviction, undefined]), - ?assertEqual( 1, rpc:call(Node1, emqx_eviction_agent, connection_count, []) @@ -168,6 +166,8 @@ t_explicit_session_takeover(Config) -> [ChanPid] = rpc:call(Node1, emqx_cm, lookup_channels, [<<"client_with_session">>]), + ok = rpc:call(Node1, emqx_eviction_agent, enable, [test_eviction, undefined]), + ?assertWaitEvent( begin ok = rpc:call(Node1, emqx_eviction_agent, evict_connections, [1]),