GH-98407: fix test_kill_issue43884 to not leak child processes (#98491)

This commit is contained in:
Kumar Aditya 2022-10-24 23:20:35 +05:30 committed by GitHub
parent 1a217f9ffc
commit 3b2724abcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -184,7 +184,10 @@ class SubprocessMixin:
self.assertEqual(-signal.SIGKILL, returncode)
def test_kill_issue43884(self):
blocking_shell_command = f'{sys.executable} -c "import time; time.sleep(100000000)"'
if sys.platform == 'win32':
blocking_shell_command = f'{sys.executable} -c "import time; time.sleep(100000000)"'
else:
blocking_shell_command = 'sleep 1; sleep 1'
creationflags = 0
if sys.platform == 'win32':
from subprocess import CREATE_NEW_PROCESS_GROUP