From ee1877a3ac41be0c9fd9283262806eebd297b155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 6 Mar 2023 15:34:29 +0100 Subject: Fix race conidtion on ExUnit suite --- lib/ex_unit/test/ex_unit/capture_log_test.exs | 12 +++++------- 1 file 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 -- cgit v1.2.1