File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -612,6 +612,19 @@ defmodule ExUnit.Callbacks do
612612
613613  Note that if the started process terminates before it is linked to the test process, 
614614  this function will exit with reason `:noproc`. 
615+ 
616+   > #### To Link or Not To Link {: .warning} 
617+   > 
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. 
625+   > 
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. 
615628  """ 
616629  @ doc  since:  "1.14.0" 
617630  @ spec  start_link_supervised! ( Supervisor . child_spec ( )  |  module  |  { module ,  term } ,  keyword )  :: 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments