Repository navigation
Fix Windows nightly test failures from path forms - #1686
Conversation
The nightly `test (windows-latest, 1|2)` legs on main fail every run since #1646 and #1658 landed. The Windows test legs run only in the nightly, so PR CI and the merge queue never saw it. All three failures compare a path built one way against a path the code built another: - governing_root: the refusal names the canonical root (`\\?\C:\Users\runneradmin\...`), but the test expected `tmp.path()`, which on runners is the 8.3 short form (`C:\Users\RUNNER~1\...`). Compare against the canonical base, as the sibling test already does. - get_failure_paths: `tmp.join("patches/x.patch")` yields a mixed `\`/`/` path on Windows, while discovery joins per component. Join per component in the test too. - user_patches: the reason and the JSON drift output carry `patches\example+1.0.0.patch` (escaped `\\` in JSON). Normalize the separators before matching the relative path. No assertion is weakened: each one still checks the same path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ee5yV3PTVTgjSkvahihT31
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 562fc93. Configure here.
|
Started a Generated by Claude Code |
|
The two failing Generated by Claude Code |
|
Ready for review (burn-down agent).
Slack announcement not sent: this run had no Slack send tool. Generated by Claude Code |
|
Labeled Ready for review (burn-down agent).
Generated by Claude Code |
|
For the reviewer: this PR makes no non-test change. Every hunk in Generated by Claude Code |
Final review briefWhat it does. This is a test-only fix for the three Windows Risk: low. Only test files and a Look here
Verified
Changes I made: none. Open questions: none. Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
Problem
The nightly CI run on main is red. Both Windows
testlegs fail on every nightly since #1646 and #1658 merged (run 39907645034, headaa69125). The Windowstestlegs run only in the nightly (vars.CI_SCOPE == 'full' || schedule || workflow_dispatch), so neither PR CI nor the merge queue caught it. All other Windows coverage stays green.test (windows-latest, 1)socket-patch-core --libhosted::governing_root::tests::vlt_project_root_governs_unlisted_directoriestest (windows-latest, 1)socket-patch-cli --test user_patchestest (windows-latest, 2)socket-patch-cli --test getget_failure_paths::engine_nested_apply_preserves_conflicts_introduced_during_fetchRoot cause
In each failing test, the expected path is spelled differently from the one the code builds, though both point at the same file:
\\?\C:\Users\runneradmin\...\vlt-lock.json. The test looks fortmp.path().join(...), and on the runners that is the 8.3 short formC:\Users\RUNNER~1\.... The panic shows both forms side by side. The sibling testvlt_project_root_overrides_the_listing_rootalready compares againstcanonicalize(tmp.path()).tmp.join("patches/x+1.0.0.patch"), which gives a mixed...\patches/x...path on Windows. User-patch discovery joinspatchesand then the directory entry, so the reason contains...\patches\x....reason.contains("patches/example+1.0.0.patch")andstdout.contains("patches/example+1.0.0.patch")on JSON. On Windows the reason holdspatches\example..., which JSON escapes as\\. The log of theuser_patchestarget falls outside the roughly 5,000 lines the job-log API returns, so this cause is inferred from the code and the other two failures, not quoted from the log.Fix
These are test-only changes. Each assertion still checks the same path:
canonicalize(tmp.path()), as the sibling test does.patchesand the file name as separate components.slashed()helper normalizes\\and\to/before the relative-pathcontainschecks. On Unix it changes nothing.Proof
Linux, local:
cargo test -p socket-patch-core --lib vlt_project_root_governs_unlisted_directories: okcargo test -p socket-patch-cli --test get engine_nested_apply_preserves_conflicts_introduced_during_fetch: okcargo test -p socket-patch-cli --test user_patches: 27 passedrustfmt --checkon the touched files: clean. Clippy reports nothing in the touched files.Windows, proven:
workflow_dispatchrun 39919335680 on this head (562fc93) passes bothtest (windows-latest, 1)andtest (windows-latest, 2); both fail on main's nightly. The only red legs in that run are the old-bundler gem legs (#1685), which fail on main in the same way.Not in this PR
The same nightly also fails
e2e-extendedgem legs (bundler 1.17.3 and 2.1.4,gem_hosted_unwind_after_unconverged_supersede_undoes_the_new_block). That one is a behaviour regression, not a path-form issue, and is filed as #1685.No tests were removed or moved.
Generated by Claude Code
Note
Low Risk
Test-only assertion updates with no runtime or product behavior changes.
Overview
Fixes Windows-only nightly test failures where assertions compared path strings that referred to the same file but used different forms (8.3 short vs canonical paths, mixed
\//separators, JSON-escaped backslashes).governing_root:vlt_project_root_governs_unlisted_directoriesnow asserts againstcanonicalize(tmp.path())for stray-lock root and refusal messages, matching sibling tests.get_failure_paths: Builds the expected user-patch path with separatejoin("patches")+ filename so it matches discovery’s per-component paths on Windows.user_patches: Addsslashed()to normalize\and\\to/beforecontainschecks on skip reasons and--checkstdout.No production code changes; semantics of the tests are unchanged.
Reviewed by Cursor Bugbot for commit 562fc93. Configure here.
Generated by Claude Code