From 924516239498f842fed963d0bd56a50bbf9eebf1 Mon Sep 17 00:00:00 2001 From: Ilya Averyanov Date: Tue, 8 Aug 2023 13:06:25 +0300 Subject: [PATCH] chore(rebalance): fix flaky test --- .../test/emqx_eviction_agent_SUITE.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 65df26387..3bbdcd707 100644 --- a/apps/emqx_eviction_agent/test/emqx_eviction_agent_SUITE.erl +++ b/apps/emqx_eviction_agent/test/emqx_eviction_agent_SUITE.erl @@ -278,13 +278,14 @@ t_session_serialization(_Config) -> emqx_eviction_agent:session_count() ), + [ChanPid0] = emqx_cm:lookup_channels(<<"client_with_session">>), + MRef0 = erlang:monitor(process, ChanPid0), + %% Evacuate to the same node - ?assertWaitEvent( - emqx_eviction_agent:evict_sessions(1, node()), - #{?snk_kind := emqx_channel_takeover_end, clientid := <<"client_with_session">>}, - 1000 - ), + _ = emqx_eviction_agent:evict_sessions(1, node()), + + ?assertReceive({'DOWN', MRef0, process, ChanPid0, _}), ok = emqx_eviction_agent:disable(test_eviction),