Skip to content

test(install): run warm-cache Codex source-pin cases in a fresh interpreter - #4264

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
p-codex-pin-windows-isolation
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
p-codex-pin-windows-isolation

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Stopgap for the Windows units red on main that 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).

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

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Local (macOS, host guard): pytest -p no:randomly -p no:xdist tests/unit/install/test_cached_codex_source_pin.py gives 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

  • One line in one section under ## [Unreleased] in CHANGELOG.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.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

…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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 9b63686 into main Nov 20, 2026
30 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the p-codex-pin-windows-isolation branch November 20, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants