fix(tests): use platform-safe timeout method#43182
Conversation
|
Thanks for this! This is already fixed on |
|
Thanks for checking, @alt-glitch — you're right, I missed that #39881 already landed the |
austinpickett
left a comment
There was a problem hiding this comment.
Fix is correct and complete. Dropping from lets auto-select the platform-appropriate method:
- POSIX: still defaults to — no behavioral regression
- Windows: falls back to , which avoids the crash on native Windows runs
The change is a single-line removal in the right place. The PR body includes a concrete before/after error trace and a verified 23-passed Windows test run. Nothing hidden here.
LGTM. ✅
austinpickett
left a comment
There was a problem hiding this comment.
Fix is correct and complete. Dropping the explicit timeout-method=signal from pyproject.toml addopts lets pytest-timeout auto-select the platform-appropriate method: POSIX still defaults to signal (no behavioral regression), while Windows falls back to 'thread', which avoids the AttributeError crash on native Windows runs (signal.SIGALRM does not exist on Windows).
The change is a single-line removal in exactly the right place. The PR body includes a concrete before/after error trace and a verified 23-passed Windows test run.
LGTM. ✅
|
Thanks again for the review and for checking this. Since the same fix already landed on main in #39881, I’ll close this to avoid adding noise. I appreciate the time you both spent looking at it. |
Problem
Running the pytest suite on native Windows can fail before tests execute because
pyproject.tomlforcespytest-timeoutto use--timeout-method=signal. Windows does not exposesignal.SIGALRM, so pytest exits with an internal error.Before / after
Before, commands such as:
failed on Windows with:
After, the timeout method is left unset so
pytest-timeoutcan choose the platform-safe default. POSIX can still use signal behavior, while Windows can fall back to its supported method.Verification
Result:
23 passed.