Skip to content

Commit 7ad99b5

Browse files
authored
Fix starter/name in Task's report callback (#14975)
1 parent ff2b738 commit 7ad99b5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/elixir/lib/task/supervised.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ defmodule Task.Supervised do
162162
~c"** When function == ~p~n" ++
163163
~c"** arguments == ~p~n" ++ ~c"** Reason for termination == ~n" ++ ~c"** ~p~n"
164164

165-
terms = [name, fun, args, get_reason(reason)]
165+
terms = [starter, fun, args, get_reason(reason)]
166166

167167
{message, terms} =
168168
case process_label do
@@ -173,7 +173,7 @@ defmodule Task.Supervised do
173173
message =
174174
~c"** Task ~p terminating~n" ++ message
175175

176-
{message, [starter | terms]}
176+
{message, [name | terms]}
177177
end
178178

179179
defp get_from({node, pid_or_name, _pid}) when node == node(), do: pid_or_name

lib/elixir/test/elixir/task_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,8 +1130,8 @@ defmodule TaskTest do
11301130
send(pid, :go)
11311131
receive do: ({:DOWN, ^ref, _, _, _} -> :ok)
11321132
end) =~ ~r"""
1133-
\[error\] \*\* Task #PID<\d+\.\d+\.\d+> terminating
1134-
\*\* Started from #PID<\d+\.\d+\.\d+>
1133+
\[error\] \*\* Task #{inspect(pid)} terminating
1134+
\*\* Started from #{inspect(parent)}
11351135
\*\* When function == &TaskTest.task/1
11361136
\*\* arguments == \[#PID<\d+\.\d+\.\d+>\]
11371137
\*\* Reason for termination ==\s

0 commit comments

Comments
 (0)