       assert [transaction] == FakeTransaction.finished_transactions(fake_transaction)
       assert [transaction] == FakeTransaction.completed_transactions(fake_transaction)
     end
-
-    test "reports an error for a timeout", %{conn: conn, fake_transaction: fake_transaction} do
-      :ok =
-        try do
-          UsingAppsignalPhoenixWithTimeout.call(conn, %{})
-        catch
-          :exit, {:timeout, {Task, :await, _}} -> :ok
-          type, reason -> {type, reason}
-        end
-
-      assert FakeTransaction.started_transaction?(fake_transaction)
-
-      [{%Appsignal.Transaction{} = transaction, name, message, _stack}] =
-        FakeTransaction.errors(fake_transaction)
-
-      assert name == ":timeout"
-      assert message =~ ~r({:timeout, {Task, :await, \[%Task{owner: ...)
-
-      assert [transaction] == FakeTransaction.finished_transactions(fake_transaction)
-      assert [transaction] == FakeTransaction.completed_transactions(fake_transaction)
-    end
   end
 end

defmodule UsingAppsignalPhoenix do
  def call(conn, _opts) do
    conn |> Plug.Conn.assign(:called?, true)
  end

  defoverridable call: 2

  use Appsignal.Phoenix
end

defmodule UsingAppsignalPhoenixWithException do
  def call(_conn, _opts) do
    raise "exception!"
  end

  defoverridable call: 2

  use Appsignal.Phoenix
end

defmodule UsingAppsignalPhoenixWithTimeout do
  def call(_conn, _opts) do
    Task.async(fn -> :timer.sleep(10) end) |> Task.await(1)
  end

  defoverridable call: 2

  use Appsignal.Phoenix
end

defmodule Appsignal.PhoenixTest do
  use ExUnit.Case
  alias Appsignal.FakeTransaction

  setup do
    {:ok, fake_transaction} = FakeTransaction.start_link()


  describe "concerning catching errors" do
    setup do
      try do
        :get
        |> conn("/exception", %{})
        |> PhoenixWithAppSignal.call([])
      catch
        :error, %Plug.Conn.WrapperError{reason: %RuntimeError{message: "Exception!"}} ->
          :ok

        type, reason ->
          {type, reason}
      end
    end

    test "reports an error for an exception", %{fake_transaction: fake_transaction} do
      assert FakeTransaction.started_transaction?(fake_transaction)

      assert [
               {
                 %Appsignal.Transaction{} = transaction,
                 "RuntimeError",
                 "Exception!",
                 _stack
               }
             ] = FakeTransaction.errors(fake_transaction)
