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).
|
meck:unload(emqx_ctl).
|
||||||
|
|
||||||
safe_unmeck(Module) ->
|
safe_unmeck(Module) ->
|
||||||
%% isolate exits
|
try
|
||||||
{Pid, Ref} = erlang:spawn_monitor(fun() -> meck:unload(Module) end),
|
meck:unload(Module),
|
||||||
receive
|
ok
|
||||||
{'DOWN', Ref, process, Pid, _} ->
|
catch
|
||||||
|
_ : _ ->
|
||||||
ok
|
ok
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue