diff options
author | José Valim <jose.valim@dashbit.co> | 2023-03-06 15:34:29 +0100 |
---|---|---|
committer | José Valim <jose.valim@dashbit.co> | 2023-03-08 10:43:27 +0100 |
commit | ee1877a3ac41be0c9fd9283262806eebd297b155 (patch) | |
tree | 491eac627b525e5632f6dc1bd8da3e5d05a5e170 | |
parent | f0c88baf37206cac613a9e360bffe37467ab8a43 (diff) | |
download | elixir-ee1877a3ac41be0c9fd9283262806eebd297b155.tar.gz |
Fix race conidtion on ExUnit suite
-rw-r--r-- | lib/ex_unit/test/ex_unit/capture_log_test.exs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/ex_unit/test/ex_unit/capture_log_test.exs b/lib/ex_unit/test/ex_unit/capture_log_test.exs index 4cf0e3db2..be52cf4ed 100644 --- a/lib/ex_unit/test/ex_unit/capture_log_test.exs +++ b/lib/ex_unit/test/ex_unit/capture_log_test.exs @@ -104,13 +104,11 @@ defmodule ExUnit.CaptureLogTest do end defp wait_capture_removal() do - case Enum.map(:logger.get_handler_config(), & &1.id) do - [ExUnit.CaptureServer] -> - Process.sleep(20) - wait_capture_removal() - - [:default] -> - :ok + if ExUnit.CaptureServer in Enum.map(:logger.get_handler_config(), & &1.id) do + Process.sleep(20) + wait_capture_removal() + else + :ok end end end |