Skip to content

gh-152548: Convert test_eintr to the test.support.isolation.runInSubprocess() decorator - #152570

Open
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:test-eintr-isolated
Open

gh-152548: Convert test_eintr to the test.support.isolation.runInSubprocess() decorator#152570
serhiy-storchaka wants to merge 2 commits into
python:mainfrom
serhiy-storchaka:test-eintr-isolated

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 29, 2026

Copy link
Copy Markdown
Member

The EINTR tests need a process with no background thread so that signals are delivered to the main thread. They were driven as a script in a child process (_test_eintr.py run via script_helper.run_test_script()), reported to the runner as a single opaque test_all.

With @isolation.runInSubprocess() each test class runs in its own fresh subprocess, so the individual EINTR tests are collected and reported (with real tracebacks) directly under test_eintr. The test code itself is unchanged; _test_eintr.py is renamed to test_eintr.py (the per-class @runInSubprocess() / @requires_resource('walltime') decorators are the only additions), and the thin wrapper is removed.

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

@vstinner, please look at this. It produces much better report.

@read-the-docs-community

read-the-docs-community Bot commented Jun 29, 2026

Copy link
Copy Markdown

serhiy-storchaka and others added 2 commits July 27, 2026 22:12
The EINTR tests need a process with no background thread so signals reach
the main thread; they were driven as a script via run_test_script.  With
@isolation.runInSubprocess() each test class runs in its own fresh
subprocess and the tests are reported individually instead of as one
opaque test_all.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
test_eintr.py was renamed from the never-collected _test_eintr.py, so its
top-level "import fcntl" now runs on every platform and crashed the module
import on Windows and WASI.  Import fcntl through import_helper so the whole
module is skipped there instead, as the EINTR tests only run on Unix.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@serhiy-storchaka serhiy-storchaka changed the title gh-152548: Convert test_eintr to the test.support.isolated() decorator gh-152548: Convert test_eintr to the test.support.isolation.runInSubprocess() decorator Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant