Bug report
test_os.test_posix_pty_functions() kills the worker process when the test suite is run in parallel on Solaris:
$ ./python -m test -j1 test_os.test_os
0:00:01 load avg: 0.12 [1/1/1] test_os.test_os worker non-zero exit code (Exit code -1 (SIGHUP))
Total tests: run=0
The whole test file is lost, so none of its 363 tests are reported. It only happens in a worker, because regrtest workers are session leaders without a controlling terminal; in sequential mode the test passes.
gh-154226 added pushing the ptem and ldterm STREAMS modules onto the slave, to make it a terminal. But that is exactly the operation which makes such a session leader acquire the slave as its controlling terminal despite O_NOCTTY — the reason why os.openpty() disowns it in gh-154225. The test does not, so closing the file descriptors revokes the controlling terminal and the kernel sends SIGHUP to the session.
sid=16933 pid=16933
CTTY ACQUIRED by the push
ttyname ok: True
SURVIVED close
rc=-1
Disowning the controlling terminal after the pushes, as os.openpty() does, fixes it.
Linked PRs
Bug report
test_os.test_posix_pty_functions()kills the worker process when the test suite is run in parallel on Solaris:The whole test file is lost, so none of its 363 tests are reported. It only happens in a worker, because regrtest workers are session leaders without a controlling terminal; in sequential mode the test passes.
gh-154226 added pushing the
ptemandldtermSTREAMS modules onto the slave, to make it a terminal. But that is exactly the operation which makes such a session leader acquire the slave as its controlling terminal despiteO_NOCTTY— the reason whyos.openpty()disowns it in gh-154225. The test does not, so closing the file descriptors revokes the controlling terminal and the kernel sendsSIGHUPto the session.Disowning the controlling terminal after the pushes, as
os.openpty()does, fixes it.Linked PRs