Fix silently-passing subprocess tests and process resource leak#112
Merged
Fix silently-passing subprocess tests and process resource leak#112
Conversation
Co-authored-by: lostmsu <239520+lostmsu@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix pickling error in multiprocessing
Fix PicklingError in spawn subprocesses with pytest 9 + Python 3.13
Mar 18, 2026
Copilot
AI
changed the title
Fix PicklingError in spawn subprocesses with pytest 9 + Python 3.13
Fix PicklingError in spawn subprocesses on Python 3.13 with pytest 9
Mar 18, 2026
…properties kwargs The real reason CI doesn't fail despite Python 3.13 being tested: run_in_subprocess never checked p.exitcode, so any subprocess crash was silently ignored by the parent test. Adding the assert immediately exposes a pre-existing bug: test_coreclr_properties passed properties=dict(...) as a single kwarg, but _do_test_coreclr_autogenerated_runtimeconfig uses **properties to collect individual kwargs. This double-wrapped the dict, causing AttributeError: 'dict' object has no attribute 'encode' in the subprocess — silently swallowed until now. Co-authored-by: lostmsu <239520+lostmsu@users.noreply.github.com>
Copilot
AI
changed the title
Fix PicklingError in spawn subprocesses on Python 3.13 with pytest 9
Fix silently-passing subprocess tests and broken property kwarg
Mar 18, 2026
… always runs Without try/finally, if `assert p.exitcode == 0` raises AssertionError, `p.close()` is never called. This leaves the Process object unclosed and causes `ResourceWarning: process ... not closed` on Python 3.12+. Co-authored-by: lostmsu <239520+lostmsu@users.noreply.github.com>
Copilot
AI
changed the title
Fix silently-passing subprocess tests and broken property kwarg
Fix silently-passing subprocess tests and process resource leak
Mar 18, 2026
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.
run_in_subprocessnever checkedp.exitcode, so subprocess crashes were invisible — tests reported PASSED while error tracebacks printed to stderr. This masked a pre-existing bug intest_coreclr_propertiesand left processes unclosed on failure.Changes
Assert subprocess exit code —
run_in_subprocessnow assertsp.exitcode == 0, turning silent subprocess failures into actual test failures.Wrap assertion in
try/finally— ensuresp.close()is always called, preventingResourceWarning: process not closedwhen the assertion raises.Fix
test_coreclr_propertieskwarg mis-passing — was passingproperties=dict(APP_CONTEXT_BASE_DIRECTORY=...), which**propertiescaptured as{'properties': {'APP_CONTEXT_BASE_DIRECTORY': ...}}, causingAttributeError: 'dict' object has no attribute 'encode'in the subprocess. Fixed by passing the kwarg directly:Move fixtures to
conftest.py— separates build fixtures from test logic.📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.