X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fpool%2Fconnections_test.exs;h=a084f31b9f0a9ec59bdd2d2e70f69878ec58337d;hb=8854770fc4e9079131a0897d5fb6c0ccccf98bc6;hp=f766e3b5f9299cf513a3e94150905a9cfac69617;hpb=d9e4b77f8be8249b428a7ef1448c9a2161dee88a;p=akkoma diff --git a/test/pool/connections_test.exs b/test/pool/connections_test.exs index f766e3b5f..a084f31b9 100644 --- a/test/pool/connections_test.exs +++ b/test/pool/connections_test.exs @@ -23,10 +23,16 @@ defmodule Pleroma.Pool.ConnectionsTest do name = :test_connections adapter = Application.get_env(:tesla, :adapter) Application.put_env(:tesla, :adapter, Tesla.Adapter.Gun) - on_exit(fn -> Application.put_env(:tesla, :adapter, adapter) end) - {:ok, _pid} = - Connections.start_link({name, [max_connections: 2, receive_connection_timeout: 1_500]}) + {:ok, pid} = Connections.start_link({name, [max_connections: 2, checkin_timeout: 1_500]}) + + on_exit(fn -> + Application.put_env(:tesla, :adapter, adapter) + + if Process.alive?(pid) do + GenServer.stop(name) + end + end) {:ok, name: name} end