test(evict): fix flapping testcase

Postpone enabling eviction agent so that target connection will not
get evicted too early.
This commit is contained in:
Andrew Mayorov 2023-05-19 13:37:36 +03:00
parent 48ceb14755
commit 5c112602b8
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 2 additions and 2 deletions

View File

@ -159,8 +159,6 @@ t_explicit_session_takeover(Config) ->
]), ]),
{ok, _, _} = emqtt:subscribe(C0, <<"t1">>), {ok, _, _} = emqtt:subscribe(C0, <<"t1">>),
ok = rpc:call(Node1, emqx_eviction_agent, enable, [test_eviction, undefined]),
?assertEqual( ?assertEqual(
1, 1,
rpc:call(Node1, emqx_eviction_agent, connection_count, []) 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">>]), [ChanPid] = rpc:call(Node1, emqx_cm, lookup_channels, [<<"client_with_session">>]),
ok = rpc:call(Node1, emqx_eviction_agent, enable, [test_eviction, undefined]),
?assertWaitEvent( ?assertWaitEvent(
begin begin
ok = rpc:call(Node1, emqx_eviction_agent, evict_connections, [1]), ok = rpc:call(Node1, emqx_eviction_agent, evict_connections, [1]),