Skip to content

Commit c1256f1

Browse files
committed
Clarify shut down order in ExUnit, closes #15236
1 parent 8f40bf1 commit c1256f1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ex_unit/lib/ex_unit/callbacks.ex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,16 @@ defmodule ExUnit.Callbacks do
4848
callbacks always run in a separate process, as implied by their name. The
4949
test process always exits with reason `:shutdown`, which means any process
5050
linked to the test process will also exit, although asynchronously. Therefore
51-
it is preferred to use `start_supervised/2` to guarantee synchronous termination.
51+
it is preferred to use `start_supervised/2` to guarantee all supervised processes
52+
have fully terminated before the next test starts.
5253
5354
Here is a rundown of the life cycle of the test process:
5455
5556
1. the test process is spawned
5657
2. it runs `setup/2` callbacks
5758
3. it runs the test itself
58-
4. it stops all supervised processes
59-
5. the test process exits with reason `:shutdown`
59+
4. the test process exits with reason `:shutdown`
60+
5. it stops all supervised processes synchronously
6061
6. `on_exit/2` callbacks are executed in a separate process
6162
6263
## Context

0 commit comments

Comments
 (0)