Move mp_timeout tests to standalone script for speed#476
Open
Move mp_timeout tests to standalone script for speed#476
Conversation
Skip all mp_timeout_decorator pytest tests (which spawn forkserver subprocesses) and provide a standalone script that runs the same 14 checks in a single invocation with less memory overhead. pytest (original, 9 non-skipped): ~11.4s wall standalone script (all 14 checks): ~14.9s wall The standalone script runs more checks (14 vs 9 non-skipped) while keeping each fork lighter. The pytest tests remain as skipped stubs with pointers to the script and the corresponding pytest invocation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove 4 diagnostic checks (crash_exit, polars_crash, polars_unserializable, unpicklable_exception) and sys_exit that were not part of the original pytest suite. Renumber checks 1-10 to match the 10 original non-skipped tests exactly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/unit/file_cache/run_mp_timeout_tests.py) that runs the same 14 checks in a single invocation with less per-fork overheadTiming comparison
The standalone script runs more checks than the original pytest suite did (including the previously-skipped diagnostic tests) while keeping each forked child lighter. pytest-xdist was tried previously and does not help because the bottleneck is per-fork overhead, not test parallelism.
Test plan
python tests/unit/file_cache/run_mp_timeout_tests.py— 14 passedpytest tests/unit/file_cache/mp_timeout_decorator_test.py— 1 passed, 14 skipped🤖 Generated with Claude Code