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):
326
326
327
327
def stop (self ):
328
328
if self .process :
329
- self .process .terminate ()
330
329
try :
331
330
self .process .communicate (timeout = 10 )
332
331
except subprocess .TimeoutExpired :
333
332
# 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 ()
335
340
self .process .stdout .close ()
336
341
self .process = None
337
342
self .conn_pool .clear ()
You can’t perform that action at this time.
0 commit comments