opts
catch
- :exit, {:timeout, _} ->
+ :exit, {:timeout, {_, operation, [_, {method, _}, _]}} ->
+ messages_len =
+ :gun_connections
+ |> Process.whereis()
+ |> Process.info(:message_queue_len)
+
Logger.warn(
- "Gun connections pool checkin with timeout error #{uri.scheme}://#{
- Connections.compose_uri(uri)
- }"
+ "Gun connections pool checkin with timeout error for #{operation} #{method} #{
+ uri.scheme
+ }://#{Connections.compose_uri(uri)}. Messages length: #{messages_len}"
)
opts
describe "connection pools" do
@describetag :integration
- clear_config([Pleroma.Gun.API]) do
- Pleroma.Config.put([Pleroma.Gun.API], Pleroma.Gun)
+ clear_config(Pleroma.Gun.API) do
+ Pleroma.Config.put(Pleroma.Gun.API, Pleroma.Gun)
end
test "gun" do
:ok
end
+ clear_config([:connections_pool, :retry]) do
+ Pleroma.Config.put([:connections_pool, :retry], 5)
+ end
+
setup do
name = :test_connections
adapter = Application.get_env(:tesla, :adapter)
describe "integration test" do
@describetag :integration
- clear_config([API]) do
- Pleroma.Config.put([API], Pleroma.Gun)
+ clear_config(API) do
+ Pleroma.Config.put(API, Pleroma.Gun)
end
test "opens connection and reuse it on next request", %{name: name} do
alias Pleroma.ReverseProxy.Client
@moduletag :integration
- clear_config_all([Pleroma.Gun.API]) do
- Pleroma.Config.put([Pleroma.Gun.API], Pleroma.Gun)
+ clear_config_all(Pleroma.Gun.API) do
+ Pleroma.Config.put(Pleroma.Gun.API, Pleroma.Gun)
end
setup do
describe "tesla client using gun integration" do
@describetag :integration
- clear_config([Pleroma.ReverseProxy.Client]) do
- Pleroma.Config.put([Pleroma.ReverseProxy.Client], Pleroma.ReverseProxy.Client.Tesla)
+ clear_config(Pleroma.ReverseProxy.Client) do
+ Pleroma.Config.put(Pleroma.ReverseProxy.Client, Pleroma.ReverseProxy.Client.Tesla)
end
- clear_config([Pleroma.Gun.API]) do
- Pleroma.Config.put([Pleroma.Gun.API], Pleroma.Gun)
+ clear_config(Pleroma.Gun.API) do
+ Pleroma.Config.put(Pleroma.Gun.API, Pleroma.Gun)
end
setup do