Skip to content

Commit 1a75456

Browse files
moogle19josevalim
authored andcommitted
Update tests to new OTP start behaviour (#12490)
1 parent 22fa810 commit 1a75456

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/logger/test/logger/translator_test.exs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -775,8 +775,10 @@ defmodule Logger.TranslatorTest do
775775
assert capture_log(:info, fn ->
776776
trap = Process.flag(:trap_exit, true)
777777
children = [worker(__MODULE__, [], function: :error)]
778-
Supervisor.start_link(children, strategy: :one_for_one)
779-
receive do: ({:EXIT, _, {:shutdown, {:failed_to_start_child, _, _}}} -> :ok)
778+
779+
assert {:error, {:shutdown, {:failed_to_start_child, __MODULE__, :stop}}} =
780+
Supervisor.start_link(children, strategy: :one_for_one)
781+
780782
Process.flag(:trap_exit, trap)
781783
end) =~ ~r"""
782784
\[error\] Child Logger.TranslatorTest of Supervisor #PID<\d+\.\d+\.\d+> \(Supervisor\.Default\) failed to start
@@ -789,8 +791,10 @@ defmodule Logger.TranslatorTest do
789791
assert capture_log(:info, fn ->
790792
trap = Process.flag(:trap_exit, true)
791793
children = [worker(__MODULE__, [], function: :undef)]
792-
Supervisor.start_link(children, strategy: :one_for_one)
793-
receive do: ({:EXIT, _, {:shutdown, {:failed_to_start_child, _, _}}} -> :ok)
794+
795+
assert {:error, {:shutdown, {:failed_to_start_child, __MODULE__, {:EXIT, _}}}} =
796+
Supervisor.start_link(children, strategy: :one_for_one)
797+
794798
Process.flag(:trap_exit, trap)
795799
end) =~ ~r"""
796800
\[error\] Child Logger.TranslatorTest of Supervisor #PID<\d+\.\d+\.\d+> \(Supervisor\.Default\) failed to start

0 commit comments

Comments
 (0)