|
|
@@ -181,16 +181,20 @@ t_discard_session(_) ->
|
|
|
ok = meck:unload(emqx_connection).
|
|
|
|
|
|
t_discard_session_race(_) ->
|
|
|
- ok = snabbkaffe:start_trace(),
|
|
|
- #{conninfo := ConnInfo0} = ?ChanInfo,
|
|
|
- ConnInfo = ConnInfo0#{conn_mod := emqx_ws_connection},
|
|
|
- {Pid, Ref} = spawn_monitor(fun() -> receive stop -> exit(normal) end end),
|
|
|
- ok = emqx_cm:register_channel(<<"clientid">>, Pid, ConnInfo),
|
|
|
- Pid ! stop,
|
|
|
- receive {'DOWN', Ref, process, Pid, normal} -> ok end,
|
|
|
- ok = emqx_cm:discard_session(<<"clientid">>),
|
|
|
- {ok, _} = ?block_until(#{?snk_kind := "session_already_gone", pid := Pid}, 1000),
|
|
|
- snabbkaffe:stop().
|
|
|
+ ?check_trace(
|
|
|
+ begin
|
|
|
+ #{conninfo := ConnInfo0} = ?ChanInfo,
|
|
|
+ ConnInfo = ConnInfo0#{conn_mod := emqx_ws_connection},
|
|
|
+ {Pid, Ref} = spawn_monitor(fun() -> receive stop -> exit(normal) end end),
|
|
|
+ ok = emqx_cm:register_channel(<<"clientid">>, Pid, ConnInfo),
|
|
|
+ Pid ! stop,
|
|
|
+ receive {'DOWN', Ref, process, Pid, normal} -> ok end,
|
|
|
+ ok = emqx_cm:discard_session(<<"clientid">>),
|
|
|
+ {ok, _} = ?block_until(#{?snk_kind := "session_already_gone", pid := Pid}, 1000)
|
|
|
+ end,
|
|
|
+ fun(_, _) ->
|
|
|
+ true
|
|
|
+ end).
|
|
|
|
|
|
t_takeover_session(_) ->
|
|
|
#{conninfo := ConnInfo} = ?ChanInfo,
|