Skip to content

Fix logger translator tests under erlang 27.1 #13839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/logger/test/logger/translator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -948,13 +948,13 @@ defmodule Logger.TranslatorTest do
test "translates Supervisor progress" do
{:ok, pid} = Supervisor.start_link([], strategy: :one_for_one)

assert capture_log(:info, fn ->
assert capture_log(:debug, fn ->
ref = Process.monitor(pid)
Supervisor.start_child(pid, worker(Task, [__MODULE__, :sleep, [self()]]))
Process.exit(pid, :normal)
receive do: ({:DOWN, ^ref, _, _, _} -> :ok)
end) =~ ~r"""
\[info\] Child Task of Supervisor #PID<\d+\.\d+\.\d+> \(Supervisor\.Default\) started
\[(debug|info)\] Child Task of Supervisor #PID<\d+\.\d+\.\d+> \(Supervisor\.Default\) started
Pid: #PID<\d+\.\d+\.\d+>
Start Call: Task.start_link\(Logger.TranslatorTest, :sleep, \[#PID<\d+\.\d+\.\d+>\]\)
"""
Expand All @@ -963,36 +963,36 @@ defmodule Logger.TranslatorTest do
test "translates Supervisor progress with name" do
{:ok, pid} = Supervisor.start_link([], strategy: :one_for_one, name: __MODULE__)

assert capture_log(:info, fn ->
assert capture_log(:debug, fn ->
ref = Process.monitor(pid)
Supervisor.start_child(pid, worker(Task, [__MODULE__, :sleep, [self()]]))
Process.exit(pid, :normal)
receive do: ({:DOWN, ^ref, _, _, _} -> :ok)
end) =~ ~r"""
\[info\] Child Task of Supervisor Logger.TranslatorTest started
\[(debug|info)\] Child Task of Supervisor Logger.TranslatorTest started
"""

{:ok, pid} = Supervisor.start_link([], strategy: :one_for_one, name: {:global, __MODULE__})

assert capture_log(:info, fn ->
assert capture_log(:debug, fn ->
ref = Process.monitor(pid)
Supervisor.start_child(pid, worker(Task, [__MODULE__, :sleep, [self()]]))
Process.exit(pid, :normal)
receive do: ({:DOWN, ^ref, _, _, _} -> :ok)
end) =~ ~r"""
\[info\] Child Task of Supervisor Logger.TranslatorTest started
\[(debug|info)\] Child Task of Supervisor Logger.TranslatorTest started
"""

{:ok, pid} =
Supervisor.start_link([], strategy: :one_for_one, name: {:via, :global, __MODULE__})

assert capture_log(:info, fn ->
assert capture_log(:debug, fn ->
ref = Process.monitor(pid)
Supervisor.start_child(pid, worker(Task, [__MODULE__, :sleep, [self()]]))
Process.exit(pid, :normal)
receive do: ({:DOWN, ^ref, _, _, _} -> :ok)
end) =~ ~r"""
\[info\] Child Task of Supervisor Logger.TranslatorTest started
\[(debug|info)\] Child Task of Supervisor Logger.TranslatorTest started
"""
end

Expand Down
Loading