test: use try catch instaed of sopan a process
This commit is contained in:
parent
929ca787f4
commit
1c448d6016
|
@ -396,9 +396,10 @@ unmock_print() ->
|
|||
meck:unload(emqx_ctl).
|
||||
|
||||
safe_unmeck(Module) ->
|
||||
%% isolate exits
|
||||
{Pid, Ref} = erlang:spawn_monitor(fun() -> meck:unload(Module) end),
|
||||
receive
|
||||
{'DOWN', Ref, process, Pid, _} ->
|
||||
try
|
||||
meck:unload(Module),
|
||||
ok
|
||||
catch
|
||||
_ : _ ->
|
||||
ok
|
||||
end.
|
||||
|
|
Loading…
Reference in New Issue