File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -326,12 +326,17 @@ def start(self):
326326
327327 def stop (self ):
328328 if self .process :
329- self .process .terminate ()
330329 try :
331330 self .process .communicate (timeout = 10 )
332331 except subprocess .TimeoutExpired :
333332 # On GHA/Windows, it always runs into a timeout, even after 45 seconds.
334- pass
333+ #
334+ # The child process is not killed if the timeout expires, so in order
335+ # to cleanup properly a well-behaved application should kill the child
336+ # process and finish communication.
337+ # https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate
338+ self .process .kill ()
339+ self .process .communicate ()
335340 self .process .stdout .close ()
336341 self .process = None
337342 self .conn_pool .clear ()
You can’t perform that action at this time.
0 commit comments