Merge branch 'fix/1658-invite-send' into 'develop'
[akkoma] / test / http / adapter_helper / gun_test.exs
index 6af8be15d0cdacfc98df2b655c84b912fbaa56ce..2e961826ede9fb72fdbb05be211799b70c77d79b 100644 (file)
@@ -6,7 +6,6 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
   use ExUnit.Case, async: true
   use Pleroma.Tests.Helpers
 
-  import ExUnit.CaptureLog
   import Mox
 
   alias Pleroma.Config
@@ -29,9 +28,7 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
   end
 
   describe "options/1" do
-    clear_config([:http, :adapter]) do
-      Config.put([:http, :adapter], a: 1, b: 2)
-    end
+    setup do: clear_config([:http, :adapter], a: 1, b: 2)
 
     test "https url with default port" do
       uri = URI.parse("https://example.com")
@@ -63,7 +60,6 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
       opts = Gun.options([receive_conn: false], uri)
 
       assert opts[:certificates_verification]
-      assert opts[:transport] == :tls
     end
 
     test "get conn on next request" do
@@ -73,14 +69,12 @@ defmodule Pleroma.HTTP.AdapterHelper.GunTest do
       on_exit(fn -> Logger.configure(level: level) end)
       uri = URI.parse("http://some-domain2.com")
 
-      assert capture_log(fn ->
-               opts = Gun.options(uri)
+      opts = Gun.options(uri)
 
-               assert opts[:conn] == nil
-               assert opts[:close_conn] == nil
-             end) =~
-               "Gun connections pool checkin was not successful. Trying to open conn for next request."
+      assert opts[:conn] == nil
+      assert opts[:close_conn] == nil
 
+      Process.sleep(50)
       opts = Gun.options(uri)
 
       assert is_pid(opts[:conn])