Repository navigation
Route the last direct pwsh spawns through the shared runner - #11303
Conversation
tests/studio/test_pwsh_calls_use_the_shared_runner.py is red on main. Seven call sites in two files start PowerShell with subprocess.run instead of run_pwsh, so they share one $XDG_CACHE_HOME/powershell startup cache with every other xdist worker and can die at startup with `Stack overflow.` or `System.IO.FileLoadException`. Three of them are mine, from #11280. The guard predates that PR and I added the file without reading it. run_pwsh takes the argv the call site already built and only redirects pwsh's own startup cache, so each of the seven is a one-word change with no invocation flags moved. The launcher case in test_studio_install_workspace_guard.py keeps its explicit `env`, which run_pwsh extends rather than replaces. tests/studio/test_pwsh_calls_use_the_shared_runner.py: 6 passed. The two converted files: 120 passed, 1 skipped.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
…i#11303) tests/studio/test_pwsh_calls_use_the_shared_runner.py is red on main. Seven call sites in two files start PowerShell with subprocess.run instead of run_pwsh, so they share one $XDG_CACHE_HOME/powershell startup cache with every other xdist worker and can die at startup with `Stack overflow.` or `System.IO.FileLoadException`. Three of them are mine, from unslothai#11280. The guard predates that PR and I added the file without reading it. run_pwsh takes the argv the call site already built and only redirects pwsh's own startup cache, so each of the seven is a one-word change with no invocation flags moved. The launcher case in test_studio_install_workspace_guard.py keeps its explicit `env`, which run_pwsh extends rather than replaces. tests/studio/test_pwsh_calls_use_the_shared_runner.py: 6 passed. The two converted files: 120 passed, 1 skipped.
The failure
Repo tests (CPU, studio)is red onmain:Reproduced locally on
origin/main:1 failed, 5 passed.Seven call sites across two files start PowerShell with
subprocess.runinstead ofrun_pwsh, so they share one$XDG_CACHE_HOME/powershellstartup cache with every other xdist worker and can die at startup withStack overflow.orSystem.IO.FileLoadException: The given assembly name was invalid.tests/python/test_compiler_watch_temp_scan.pytests/test_studio_install_workspace_guard.pyThree of those are mine. I added
test_compiler_watch_temp_scan.pyin #11280 without reading the guard that was already there, so this is my regression, not a pre-existing one I happened to find.The fix
run_pwshtakes the argv the call site already built and only redirects pwsh's own startup cache, so each site is a one-word change and no invocation flags move. The launcher case attest_studio_install_workspace_guard.py:520keeps its explicitenv, whichrun_pwshextends rather than replaces, so the hermetic environment that test builds is preserved.No test assertion is changed, and the guard is not touched or widened: the point is to satisfy it, not to quiet it.
_ALLOWED_DIRECT_PWSH_CALLSexists for call sites that really are safe, and none of these seven qualifies -- they all hand the child the ambientHOME.Verification
tests/studio/test_pwsh_calls_use_the_shared_runner.py: 6 passed (was 1 failed, 5 passed onmain).ruff checkclean on all three files.