Skip to content

Commit 45cb2a6

Browse files
Apply suggestions from code review
Co-authored-by: José Valim <[email protected]>
1 parent d5733cc commit 45cb2a6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/ex_unit/lib/ex_unit/callbacks.ex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -613,18 +613,18 @@ defmodule ExUnit.Callbacks do
613613
Note that if the started process terminates before it is linked to the test process,
614614
this function will exit with reason `:noproc`.
615615
616-
> #### To Link or Not To Link {: .warning}
616+
> #### To link or not to link {: .warning}
617617
>
618-
> When using `start_link_supervised!/2`, be aware that the order of process termination
619-
> during test exit is not guaranteed (for the processes started with
620-
> `start_link_supervised!/2`). When the test process exits, the crash signal propagates
621-
> to all linked processes virtually simultaneously, which can lead to processes
622-
> terminating in an unpredictable order. This is particularly problematic when you have
623-
> processes that the test starts with `start_link_supervised!/2` and that depend on
624-
> each other.
618+
> When using `start_link_supervised!/2`, the test process will be linked to the
619+
> spawned processes. When the test process exits, it exits with reason `:shutdown`,
620+
> and the crash signal propagates to all linked processes virtually simultaneously,
621+
> which can lead to processes terminating in an unpredictable order if they are not
622+
> trapping exits. This is particularly problematic when you have processes that the
623+
> test starts with `start_link_supervised!/2` and that depend on each other.
625624
>
626-
> If you need guaranteed shutdown order, use `start_supervised/2`. With that, processes
627-
> are shut down *by the test supervisor* in reverse order, ensuring graceful termination.
625+
> If you need guaranteed shutdown order, use `start_supervised!/2`. This way the
626+
> test process exiting does not affect the started processes, and they will be shut down
627+
> *by the test supervisor* in reverse order, ensuring graceful termination.
628628
"""
629629
@doc since: "1.14.0"
630630
@spec start_link_supervised!(Supervisor.child_spec() | module | {module, term}, keyword) ::

0 commit comments

Comments
 (0)