gh-119273: Don't run test_ioctl in a process group (#119275)

Python test runner no longer runs tests using TTY (ex: test_ioctl) in
a process group (using setsid()). Previously, tests using TTY were
skipped.
This commit is contained in:
Victor Stinner 2024-05-29 14:44:09 +02:00 committed by GitHub
parent 055c739536
commit 1f481fd327
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 3 deletions

View file

@ -14,6 +14,9 @@ from .utils import (
USE_PROCESS_GROUP = (hasattr(os, "setsid") and hasattr(os, "killpg"))
NEED_TTY = set('''
test_ioctl
'''.split())
def create_worker_process(runtests: WorkerRunTests, output_fd: int,
@ -47,7 +50,10 @@ def create_worker_process(runtests: WorkerRunTests, output_fd: int,
close_fds=True,
cwd=work_dir,
)
if USE_PROCESS_GROUP:
# Don't use setsid() in tests using TTY
test_name = runtests.tests[0]
if USE_PROCESS_GROUP and test_name not in NEED_TTY:
kwargs['start_new_session'] = True
# Pass json_file to the worker process