Skip to content

Fix Windows nightly test failures from path forms - #1686

Merged
Mikola Lysenko (mikolalysenko) merged 1 commit into
mainfrom
ci-janitor/windows-nightly-path-asserts
Oct 23, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 1 commit into
mainfrom
ci-janitor/windows-nightly-path-asserts

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The nightly CI run on main is red. Both Windows test legs fail on every nightly since #1646 and #1658 merged (run 39907645034, head aa69125). The Windows test legs 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.

job failing target test
test (windows-latest, 1) socket-patch-core --lib hosted::governing_root::tests::vlt_project_root_governs_unlisted_directories
test (windows-latest, 1) socket-patch-cli --test user_patches (log cut off by the API; same pattern, see below)
test (windows-latest, 2) socket-patch-cli --test get get_failure_paths::engine_nested_apply_preserves_conflicts_introduced_during_fetch

Root cause

In each failing test, the expected path is spelled differently from the one the code builds, though both point at the same file:

  • governing_root: the refusal names the canonical root, \\?\C:\Users\runneradmin\...\vlt-lock.json. The test looks for tmp.path().join(...), and on the runners that is the 8.3 short form C:\Users\RUNNER~1\.... The panic shows both forms side by side. The sibling test vlt_project_root_overrides_the_listing_root already compares against canonicalize(tmp.path()).
  • get_failure_paths (line 1660): the expected path is tmp.join("patches/x+1.0.0.patch"), which gives a mixed ...\patches/x... path on Windows. User-patch discovery joins patches and then the directory entry, so the reason contains ...\patches\x....
  • user_patches: reason.contains("patches/example+1.0.0.patch") and stdout.contains("patches/example+1.0.0.patch") on JSON. On Windows the reason holds patches\example..., which JSON escapes as \\. The log of the user_patches target 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:

  • governing_root: compare against canonicalize(tmp.path()), as the sibling test does.
  • get_failure_paths: join patches and the file name as separate components.
  • user_patches: a slashed() helper normalizes \\ and \ to / before the relative-path contains checks. On Unix it changes nothing.

Proof

Linux, local:

  • cargo test -p socket-patch-core --lib vlt_project_root_governs_unlisted_directories: ok
  • cargo test -p socket-patch-cli --test get engine_nested_apply_preserves_conflicts_introduced_during_fetch: ok
  • cargo test -p socket-patch-cli --test user_patches: 27 passed
  • rustfmt --check on the touched files: clean. Clippy reports nothing in the touched files.

Windows, proven: workflow_dispatch run 39919335680 on this head (562fc93) passes both test (windows-latest, 1) and test (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-extended gem 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_directories now asserts against canonicalize(tmp.path()) for stray-lock root and refusal messages, matching sibling tests.

get_failure_paths: Builds the expected user-patch path with separate join("patches") + filename so it matches discovery’s per-component paths on Windows.

user_patches: Adds slashed() to normalize \ and \\ to / before contains checks on skip reasons and --check stdout.

No production code changes; semantics of the tests are unchanged.

Reviewed by Cursor Bugbot for commit 562fc93. Configure here.


Generated by Claude Code

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
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Oct 23, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Started a workflow_dispatch CI run on this branch (head 562fc93) so the Windows test (windows-latest, *) legs actually run before merge: https://github.com/SocketDev/socket-patch/actions/runs/39919335680. If both Windows test legs pass there, the fix is proven. This PR is the only open fix for the red nightly Windows legs on main.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

The two failing e2e-extended (ubuntu-latest, e2e_redirect_gem_build e2e_vendor_gem_build, 3.1, 1.17.3 | 2.1.4) checks in dispatch run 39919335680 are not caused by this PR. Both legs fail the same way on main in the nightly (39907645034, head aa69125). The failing test is gem_hosted_unwind_after_unconverged_supersede_undoes_the_new_block, which came in with #1664. This PR changes only three test files, none of them gem-related. The failure is tracked in #1685, and no fix exists yet, so nothing is ported here. I did not re-run the checks because the failure reproduces on every run of main. What decides this PR is the two test (windows-latest, *) legs in the same run.


Generated by Claude Code

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 23, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Ready for review (burn-down agent).

Slack announcement not sent: this run had no Slack send tool.


Generated by Claude Code

@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

Labeled Ready for review (burn-down agent).


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

For the reviewer: this PR makes no non-test change. Every hunk in crates/socket-patch-core/src/hosted/governing_root.rs (lines 3289–3323) sits inside its #[cfg(test)] mod tests (from line 1267), in vlt_project_root_governs_unlisted_directories, so library behaviour is unchanged on every platform.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Final review brief

What it does. This is a test-only fix for the three Windows test legs that have been red on every nightly since #1646/#1658. Each assertion had spelled the expected path differently from the path the code builds: an 8.3 short temp dir instead of the canonical root, a mixed \// join, and JSON-escaped \\. The assertions now compare like with like. No product code changes.

Risk: low. Only test files and a #[cfg(test)] module change, and every assertion still checks the same path. The Windows fix is proven by the workflow_dispatch run 39919335680 on this head: both test (windows-latest, 1/2) legs pass.

Look here

  • governing_root.rs:3289–3292 and :3323: compare against canonicalize(tmp), as the sibling test already does
  • get_failure_paths.rs:1617–1622:``` join patches and the file name as separate components
  • user_patches.rs:19–23: the slashed() helper, used at :96 and :232; it changes nothing on Unix

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

Merged via the queue into main with commit 1749474 Oct 23, 2026
345 of 348 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the ci-janitor/windows-nightly-path-asserts branch October 23, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants