diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec874826..5e468b7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,6 @@ jobs: MIX_ENV: test # TODO: Remove on Req 1.0 REQ_NOWARN_OUTPUT: true - # TODO: Remove on next finch - FINCH_REF: main strategy: fail-fast: false matrix: diff --git a/lib/req/steps.ex b/lib/req/steps.ex index b3089653..97a51334 100644 --- a/lib/req/steps.ex +++ b/lib/req/steps.ex @@ -1113,7 +1113,7 @@ defmodule Req.Steps do {:ok, decompressed} = :brotli.decode(body) decompress_body(rest, decompressed, acc) else - Logger.debug("decompress_body: :brotli library not loaded, skipping brotli decompression") + Logger.debug(":brotli library not loaded, skipping brotli decompression") decompress_body(rest, body, ["br" | acc]) end end @@ -1122,7 +1122,7 @@ defmodule Req.Steps do if ezstd_loaded?() do decompress_body(rest, :ezstd.decompress(body), acc) else - Logger.debug("decompress_body: :ezstd library not loaded, skipping zstd decompression") + Logger.debug(":ezstd library not loaded, skipping zstd decompression") decompress_body(rest, body, ["zstd" | acc]) end end @@ -1132,7 +1132,7 @@ defmodule Req.Steps do end defp decompress_body([codec | rest], body, acc) do - Logger.debug("decompress_body: algorithm #{inspect(codec)} is not supported") + Logger.debug("algorithm #{inspect(codec)} is not supported") decompress_body(rest, body, [codec | acc]) end diff --git a/test/req/steps_test.exs b/test/req/steps_test.exs index 1da5ac27..fb0a4bab 100644 --- a/test/req/steps_test.exs +++ b/test/req/steps_test.exs @@ -646,9 +646,13 @@ defmodule Req.StepsTest do |> Plug.Conn.send_resp(200, body) end - assert Req.get!("", plug: plug).body |> :zlib.uncompress() |> Jason.decode!() == %{ - "a" => 1 - } + {resp, log} = + ExUnit.CaptureLog.with_log(fn -> + Req.get!("", plug: plug) + end) + + assert resp.body |> :zlib.uncompress() |> Jason.decode!() == %{"a" => 1} + assert log =~ ~s|algorithm \"deflate\" is not supported| end describe "redirect" do diff --git a/test/test_helper.exs b/test/test_helper.exs index 3ace6553..df264421 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -7,9 +7,15 @@ defmodule TestServer do end defp accept(listen_socket, fun) do - {:ok, socket} = :gen_tcp.accept(listen_socket) - fun.(socket) - :ok = :gen_tcp.close(socket) + case :gen_tcp.accept(listen_socket) do + {:ok, socket} -> + fun.(socket) + :ok = :gen_tcp.close(socket) + + {:error, :closed} -> + :ok + end + accept(listen_socket, fun) end end