Repository navigation
test(install): run warm-cache Codex source-pin cases in a fresh interpreter - #4264
Merged
Daniel Meppiel (danielmeppiel) merged 1 commit intoNov 20, 2026
Merged
Conversation
…nterpreter Earlier tests on the same xdist worker leave module state that makes the in-process frozen global install refuse Codex admission on Windows units after the #4144 shard reshuffle. Each case now re-runs its own node id in a new interpreter so the scenario starts from a clean process. The polluter root cause follows separately. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 10:51
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The nested pytest invocation can fail on inherited PYTEST_ADDOPTS and does not preserve CI coverage for the production code it exercises.
2 open issues
What changed in this PR
This PR isolates the warm-cache Codex source-pin tests from shared pytest worker state as a stopgap for Windows unit failures. Production behavior is unchanged; identifying the underlying state leak remains follow-up work.
Changes:
- Re-runs each parameterized case by its exact node ID in a fresh interpreter.
- Adds a recursion guard, a child-process timeout, and assertions that the child successfully ran one test.
| File | Description |
|---|---|
tests/unit/install/test_cached_codex_source_pin.py |
Adds fresh-process execution while preserving the existing source-pin scenario and assertions. |
Review effort: Balanced
Daniel Meppiel (danielmeppiel)
deleted the
p-codex-pin-windows-isolation
branch
November 20, 2026 11:05
6 of 10 tasks
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.

Description
Stopgap for the Windows units red on
mainthat blocks every PR:tests/unit/install/test_cached_codex_source_pin.py::test_frozen_global_install_from_warm_cache_uses_locked_source_pin[*]fails with "Codex admission no longer matches the saved executable/ownership state"
(
install/phases/codex_plugins.py:23).src/; it only added a unit test file. That reshuffled the shards, so this test now runs on gw1 after many more in-process install tests.This PR makes each case re-run its own node id in a fresh interpreter, so the scenario always starts from a clean process. The polluter root cause and a leak-detector extension for that state family follow in a separate PR.
Issue and approved scope
Issue: Part of #4115 (wider PR checks / Windows units; release gate item 6: main green, no quarantine)
Human scope-approval comment: the #4115 apm-scope:v1 record; the 0.37 PM assigned this fix to stream P.
Does this PR complete the issue, or what remains? No. The polluter root cause follows separately.
Type of change
Testing
Local (macOS, host guard):
pytest -p no:randomly -p no:xdist tests/unit/install/test_cached_codex_source_pin.pygives 5 passed. Ruff check and format pass on the changed file. Windows proof comes from this PR's Windows Compatibility Gate shards and the next main push.Changelog
## [Unreleased]inCHANGELOG.md: user-visible effect first, 25 words or fewer, ending with(#PR); breaking changes only under upgrade notes; no Highlights; see.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)