Skip to content

Commit 4a7e541

Browse files
author
José Valim
committed
Fix race condition in task_test.exs, closes #4130
1 parent 403c85c commit 4a7e541

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/elixir/test/elixir/task_test.exs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ defmodule TaskTest do
279279
task3 = Task.async(fn -> exit :normal end)
280280

281281
send(self(), {task1.ref, :result})
282+
ref = Process.monitor(task3.pid)
283+
assert_receive {:DOWN, ^ref, _, _, :normal}
282284

283285
assert Task.yield_many([task1, task2, task3], 0) ==
284286
[{task1, {:ok, :result}}, {task2, nil}, {task3, {:exit, :normal}}]

0 commit comments

Comments
 (0)