Skip to content

Commit 8c8f6d8

Browse files
author
José Valim
committed
Merge pull request #2743 from fishcakez/loggertest_exit_signal_rc
Fix exit signal race condition in logger tests
2 parents 7f7aaa1 + 3950130 commit 8c8f6d8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/logger/test/logger/translator_test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ defmodule Logger.TranslatorTest do
351351
trap = Process.flag(:trap_exit, true)
352352
Supervisor.start_link([worker(__MODULE__, [], [function: :error])],
353353
[strategy: :one_for_one])
354+
receive do: ({:EXIT, _, {:shutdown, {:failed_to_start_child, _, _}}} -> :ok)
354355
Process.flag(:trap_exit, trap)
355356
end) =~ ~r"""
356357
\[error\] Child Logger.TranslatorTest of Supervisor #PID<\d+\.\d+\.\d+> \(Supervisor\.Default\) failed to start
@@ -364,6 +365,7 @@ defmodule Logger.TranslatorTest do
364365
trap = Process.flag(:trap_exit, true)
365366
Supervisor.start_link([worker(__MODULE__, [], [function: :undef])],
366367
[strategy: :one_for_one])
368+
receive do: ({:EXIT, _, {:shutdown, {:failed_to_start_child, _, _}}} -> :ok)
367369
Process.flag(:trap_exit, trap)
368370
end) =~ ~r"""
369371
\[error\] Child Logger.TranslatorTest of Supervisor #PID<\d+\.\d+\.\d+> \(Supervisor\.Default\) failed to start

0 commit comments

Comments
 (0)