Skip to content

Commit 00b2118

Browse files
committed
Change receive/send to sleep/exit
1 parent 0458a07 commit 00b2118

2 files changed

Lines changed: 6 additions & 18 deletions

File tree

test/gen_servers/callback_tracing_server_test.exs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,9 @@ defmodule LiveDebugger.GenServers.CallbackTracingServerTest do
2020
end
2121

2222
setup do
23-
pid =
24-
spawn(fn ->
25-
receive do
26-
:stop ->
27-
:ok
28-
end
29-
end)
23+
pid = spawn(fn -> Process.sleep(:infinity) end)
3024

31-
on_exit(fn -> send(pid, :stop) end)
25+
on_exit(fn -> Process.exit(pid, :kill) end)
3226

3327
%{pid: pid}
3428
end
@@ -71,7 +65,7 @@ defmodule LiveDebugger.GenServers.CallbackTracingServerTest do
7165
test "removes table after process exits", %{pid: pid} do
7266
ref = CallbackTracingServer.table!(pid)
7367

74-
send(pid, :stop)
68+
Process.exit(pid, :kill)
7569

7670
Process.sleep(200)
7771

test/services/trace_service_test.exs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,9 @@ defmodule Services.TraceServiceTest do
2121
end
2222

2323
setup context do
24-
pid =
25-
spawn(fn ->
26-
receive do
27-
:stop ->
28-
:ok
29-
end
30-
end)
31-
32-
on_exit(fn -> send(pid, :stop) end)
24+
pid = spawn(fn -> Process.sleep(:infinity) end)
25+
26+
on_exit(fn -> Process.exit(pid, :kill) end)
3327

3428
Map.put(context, :pid, pid)
3529
end

0 commit comments

Comments
 (0)