🐛 fix(discovery): harden subprocess interrogation and test reliability#3054
Merged
gaborbernat merged 1 commit intopypa:mainfrom Feb 18, 2026
Merged
Conversation
f939be0 to
711e66d
Compare
auto-merge was automatically disabled
February 18, 2026 14:59
Pull request was converted to draft
7e5ecd8 to
9f036b1
Compare
659839e to
9f0a61e
Compare
9f0a61e to
ee86f3b
Compare
…y tests Python interpreter discovery was failing in edge cases where cached metadata became corrupted or subprocess interrogation encountered transient issues. The discovery cache now gracefully handles corrupted entries and subprocess interrogation retries once on failure. Additionally optimized GraalPy test execution by introducing a minimal marker-based test suite that validates core functionality while reducing test count from 1000+ to 30 parametrized cases. Disabled JIT compilation and limited parallelism to 4 workers to prevent resource exhaustion.
57985e2 to
f6e3aab
Compare
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.
Python interpreter discovery was failing in edge cases where cached metadata became corrupted or subprocess interrogation encountered transient issues. This manifested as
KeyErrorcrashes when loading cached interpreter info and occasional test failures in CI where subprocess calls would timeout or return malformed JSON.The discovery cache now gracefully handles corrupted entries by catching
KeyErrorandTypeErrorwhen deserializing cached data, removing the invalid cache file, and falling back to fresh interrogation. 🔧 Subprocess interrogation also retries once on failure to handle transient issues like process spawning delays or temporary resource exhaustion.Additionally optimized GraalPy test execution by introducing a marker-based test suite (
@pytest.mark.graalpy) that validates core functionality: discovery, venv creation, activation, and integration. This reduces the test count from 1000+ to 30 essential parametrized test cases while maintaining confidence in the core contract.GraalPy runs 4-6x slower than CPython per their documentation, making full test coverage impractical. The optimized suite focuses on high-value tests rather than edge cases and integration combinations. JIT compilation is disabled for GraalPy tests since the suite runs too briefly to benefit from warmup. Parallelism is limited to 4 workers matching GraalPy's own test infrastructure to prevent resource exhaustion.