Skip to content

Commit

Permalink
Use start_supervised in Retry test
Browse files Browse the repository at this point in the history
  • Loading branch information
teamon committed Apr 18, 2023
1 parent b8791bc commit 76c7ede
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/tesla/middleware/retry_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ defmodule Tesla.Middleware.RetryTest do
defmodule LaggyAdapter do
def start_link, do: Agent.start_link(fn -> 0 end, name: __MODULE__)

def child_spec(_opts) do
%{id: __MODULE__, start: {__MODULE__, :start_link, []}}
end

def call(env, _opts) do
Agent.get_and_update(__MODULE__, fn retries ->
response =
Expand Down Expand Up @@ -48,7 +52,7 @@ defmodule Tesla.Middleware.RetryTest do
end

setup do
{:ok, _} = LaggyAdapter.start_link()
start_supervised!(LaggyAdapter)
:ok
end

Expand Down

0 comments on commit 76c7ede

Please sign in to comment.