Repository navigation
Fix Windows nightly Maven ~/.m2 fallback test - #1962
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
Nightly CI on main has failed test (windows-latest, 1) every night since 2026-10-30: get_maven_repo_paths_home_dot_m2_fallback returns [] instead of <tmp>/.m2/repository. #1801 made Maven's user.home on Windows read USERPROFILE before HOME, as the JVM does, but the test only moved HOME, so the crawler looked in the runner's real profile. Run both HOME-fallback tests under NoJvmCaches::with_home, which points HOME and USERPROFILE at the test's directory, clears the other Maven/JVM variables and restores everything on drop, also when an assertion panics. The no-m2 test passed on the runner only because its real profile has no .m2. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aeRXDcg7ce8xkkpQdxf
|
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 5003425. Configure here.
|
Ready for review at head
Generated by Claude Code |
Final review briefWhat it does: Test-only fix for the Windows nightly failure in Risk: low. Only Look here
Verified: read the full diff and the guard's key list. Changes I made: none. Open questions: none blocking. Nit: Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
|
On the Generated by Claude Code |
Wenxin Jiang (Wenxin-Jiang)
left a comment
There was a problem hiding this comment.
[agent] Reviewed 5003425210b63af9fd9d88d151439ccc8c1e3af0. Checked the HOME/USERPROFILE guard and restoration against Maven home resolution. No major correctness issues found. Validation: source and regression-test review plus the available exact-head CI checks; no local test pass is claimed.
|
Closing as superseded by #1852, which merged at 15:49 UTC and fixes the same Windows nightly failure in the same way: both home-fallback tests now set What this PR still adds on top is minor: the variables are restored even when an assertion fails, and the other JVM variables are cleared. It is not worth a separate merge. I missed #1852 when checking for duplicate open PRs because I read only the first 50 open PRs. Generated by Claude Code |
Problem
Nightly CI on
mainhas been red three nights running, and one of the three failing jobs has no open fix:test (windows-latest, 1)fails inget_maven_repo_paths_home_dot_m2_fallback:The other two nightly failures already have open PRs: macOS
test (macos-latest, 2)GOWORK is #1894, ande2e_bun_lockbis #1905.Root cause
#1801 (ca6dc05) fixed Maven's
user.homeon Windows to readUSERPROFILEbeforeHOME, the way the JVM does. The test only movedHOME, so on Windows the crawler looked in the runner's real profile, found no.m2/repositorythere, and returned nothing. Linux and macOS readHOMEfirst, so PR and merge-queue legs stayed green. The Windows test legs run only nightly or on dispatch.Fix
This changes only the test.
NoJvmCachesgets awith_home(path)constructor that points bothHOMEandUSERPROFILEat the test's directory. Likenew(), it clears the other Maven and JVM variables (MAVEN_OPTS,MAVEN_ARGS,M2_HOME,MAVEN_HOME, …) and restores them on drop, including when an assertion panics. Before, the hand-written restore was skipped on panic and leakedHOMEinto later#[serial]tests.Both HOME-fallback tests now use it:
get_maven_repo_paths_home_dot_m2_fallback: this is the failing test.get_maven_repo_paths_global_mode_no_m2_returns_empty: it had the same bug. It passed on the runner only because the real profile has no.m2, so it would fail on a developer's Windows machine.No assertion changed, and no production code changed.
Proof
cargo test -p socket-patch-core --test crawler_maven_e2eon Linux: 28/28 pass.cargo clippy -p socket-patch-core --test crawler_maven_e2e -- -D warningsis clean.test (windows-latest, 1),get_maven_repo_paths_home_dot_m2_fallback ... okandget_maven_repo_paths_global_mode_no_m2_returns_empty ... ok.Where tests run
No test was removed or moved.
https://claude.ai/code/session_011f9aeRXDcg7ce8xkkpQdxf
Generated by Claude Code