Repository navigation
Fix Maven home tests failing on Windows nightly - #1852
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Conversation
#1801 made the Maven local-repository lookup read user.home the way Java does: USERPROFILE on Windows, HOME elsewhere. The two crawler_maven_e2e home-fallback tests still pointed only HOME at their temp dir, so on Windows the crawler looked in the runner's real profile and get_maven_repo_paths_home_dot_m2_fallback failed in the Windows test shard on main. The no-.m2 test passed there only because the runner has no real ~/.m2. Point the platform's home variable at the temp dir instead, as #1814 did for the cargo home tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aePZNoNmNU3zNg5Latx
|
bugbot run Generated by Claude Code |
The global-mode test also walks the Coursier and Ivy caches, which read HOME first on every OS. Redirecting only USERPROFILE on Windows would let the runner's real HOME leak into its empty-list assertion. Point both variables at the temp dir in both home tests, and restore both afterwards. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aePZNoNmNU3zNg5Latx
|
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 c8f2314. Configure here.
|
Burn-down agent: labeled Ready for review at
Generated by Claude Code |
|
[agent] Labeled Ready for review at
Generated by Claude Code |
Final review briefWhat it does: A test-only fix for the Windows nightly. #1801 made Maven's Risk: low. Only test code changes. Restore is correct for previously-unset variables, and there is no race: the other tests in the file are Look here: Verified: I read the diff. Changes I made: none. Open questions: none. Optional follow-up: the existing Auto-merge (squash) is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
Problem
The Windows test shard 1 is red on main. The 2026-10-29 nightly failed both Windows shards; #1814 and #1816 fixed what was failing then, so I re-ran a Windows-only dispatch on main at
c07af61to check: run 40942139555. Shard 2 and every Windows e2e leg pass now. Shard 1 still fails, on a new test:Without this fix the next nightly on main will be red on Windows again.
Root cause
#1801 (merged 13:26 UTC today) changed the Maven local-repository lookup to read
user.homethe way Java does:USERPROFILEfirst on Windows,HOMEelsewhere. Two home-fallback tests incrawler_maven_e2e.rsstill set onlyHOMEto their temp dir. On Windows the crawler therefore read the runner's real profile directory, which has no.m2.get_maven_repo_paths_global_mode_no_m2_returns_emptyhas the same bug but passes only because that runner has no real~/.m2.This is the same class of bug as #1814 (cargo home tests after #1779).
Fix
Point both
HOMEandUSERPROFILEat the temp dir in both home tests, and restore both afterwards. Maven'suser.homeprefersUSERPROFILEon Windows, while the Coursier and Ivy lookups that--globalalso walks preferHOMEeverywhere. Bugbot pointed out that redirecting only the platform's variable, as #1814 did for cargo, would leave the second one leaking. Only test code changes; no assertion is weakened.Proof
cargo test -p socket-patch-core --test crawler_maven_e2egives 28/28 passing, and the same 28/28 on 30 looped runs.cargo clippy -p socket-patch-core --test crawler_maven_e2e -- -D warningsis clean, and so isrustfmt --checkon the touched file.test (windows-latest, 1), which failed on main: run 40946507476 (first commit) and run 40952032589 (final commit).Where tests run
No test is removed or moved.
Generated by Claude Code
Note
Low Risk
Test-only environment setup in Maven e2e tests; no production crawler or assertion changes.
Overview
Fixes Windows CI failures in Maven crawler e2e tests after production started resolving
user.homelike Java (USERPROFILEbeforeHOMEon Windows).Two serial tests in
crawler_maven_e2e.rsthat isolate home-based.m2/repositorydiscovery previously set onlyHOMEto a temp directory. On Windows the crawler still read the real profile, soget_maven_repo_paths_home_dot_m2_fallbackcould see an empty repo list instead of the staged path.The change introduces a shared
HOME_VARSlist and sets and restores bothHOMEandUSERPROFILEin those tests, matching the existingNoJvmCacheshelper and avoiding leaks from Coursier/Ivy paths that still useHOMEeverywhere. Assertions are unchanged; this is test harness only.Reviewed by Cursor Bugbot for commit c8f2314. Configure here.
Generated by Claude Code