Files
parrhesia/test/test_helper.exs
Steffen Beyer 84f83a48d7
Some checks failed
CI / Test (OTP 27.2 / Elixir 1.18.2) (push) Failing after 0s
CI / Test (OTP 28.4 / Elixir 1.19.4 + Marmot E2E) (push) Failing after 0s
chore: Bump version to 0.6.0, fix tests
2026-03-18 21:54:44 +01:00

48 lines
1.2 KiB
Elixir

exclude_tags =
if System.get_env("PARRHESIA_NAK_E2E") == "1" do
[]
else
[:nak_e2e]
end
# Suppress Postgrex disconnect logs that fire during sandbox teardown.
# When a sandbox-owning process exits, the connection pool detects the
# dead client and logs an error asynchronously. This is expected cleanup
# noise, not a real failure — silence it so test output stays pristine.
:logger.add_primary_filter(
:suppress_sandbox_disconnect,
{fn
%{msg: {:string, chars}}, _extra ->
if :string.find(IO.chardata_to_string(chars), "(DBConnection.ConnectionError)") != :nomatch do
:stop
else
:ignore
end
_event, _extra ->
:ignore
end, []}
)
# Suppress Req retry warnings (e.g. transient socket closures during tests).
# These are expected when tests tear down HTTP connections mid-flight.
:logger.add_primary_filter(
:suppress_req_retry,
{fn
%{msg: {:string, chars}}, _extra ->
str = IO.chardata_to_string(chars)
if :string.find(str, "retry:") != :nomatch or
:string.find(str, "Req.TransportError") != :nomatch do
:stop
else
:ignore
end
_event, _extra ->
:ignore
end, []}
)
ExUnit.start(exclude: exclude_tags)