@@ -113,13 +113,24 @@ def main():
113113 # This test has Tini spawn a process that ignores SIGUSR1 and spawns a child that doesn't (and waits on the child)
114114 # We send SIGUSR1 to Tini, and expect the grand-child to terminate, then the child, and then Tini.
115115 if not args_disabled :
116- print "Running process group test"
116+ print "Running process group test (arguments) "
117117 p = subprocess .Popen ([tini , '-g' , os .path .join (src , "test" , "pgroup" , "stage_1.py" )], stdout = subprocess .PIPE , stderr = subprocess .PIPE )
118118
119119 busy_wait (lambda : len (psutil .Process (p .pid ).children (recursive = True )) == 2 , 10 )
120120 p .send_signal (signal .SIGUSR1 )
121121 busy_wait (lambda : p .poll () is not None , 10 )
122122
123+ print "Running process group test (environment variable)"
124+ p = subprocess .Popen (
125+ [tini , os .path .join (src , "test" , "pgroup" , "stage_1.py" )],
126+ stdout = subprocess .PIPE , stderr = subprocess .PIPE ,
127+ env = dict (os .environ , TINI_KILL_PROCESS_GROUP = "1" )
128+ )
129+
130+ busy_wait (lambda : len (psutil .Process (p .pid ).children (recursive = True )) == 2 , 10 )
131+ p .send_signal (signal .SIGUSR1 )
132+ busy_wait (lambda : p .poll () is not None , 10 )
133+
123134 # Run failing test. Force verbosity to 1 so we see the subreaper warning
124135 # regardless of whether MINIMAL is set.
125136 print "Running zombie reaping failure test (Tini should warn)"
0 commit comments