   end
 
   describe "handle_event/3, with an open span" do
-    setup do
+    setup %{pid: pid} do
       parent = self()
 
-      pid =
-        spawn(fn ->
-          span = Tracer.create_span("background_job")
-          send(parent, span)
-          raise "Exception"
-        end)
+      Murphy.call(pid, fn ->
+        span = Tracer.create_span("background_job")
+        send(parent, span)
+        raise "Exception"
+      end)
 
       span =
         receive do
           span -> span
         end
 
-      [pid: pid, span: span]
+      [span: span]
     end
 
     test "adds an error to the existing span", %{span: span} do

  end

  describe "handle_event/3, with an ignored process" do
    setup do
      [
        pid:
          spawn(fn ->
            Tracer.ignore()
            raise "Exception"
          end)
      ]
    end

    test "does not create a span", %{pid: pid} do
      repeatedly(fn ->
        assert Test.Tracer.get(:create_span) == :error
      end)

    _ = Map.fetch!(%{}, :bad_key)

    {:noreply, state}
  end
end

defmodule Murphy do
  import ExUnit.Assertions
  use GenServer

  def start_link(_opts) do
    GenServer.start(__MODULE__, [])
  end

  def init(opts), do: {:ok, opts}

  def handle_call(fun, _from, _state) do
    fun.()
  end

  def call(pid, fun) do
    ExUnit.CaptureLog.capture_log(fn ->
      catch_exit do
        GenServer.call(pid, fun)
      end
    end)
  end
end

