Repository navigation
Ride out crates.io blips in required cargo e2e legs - #1459
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
The cargo-vex-matrix lock-v4 leg failed on PR #1449 (run 38307581268, attempt 1; green on re-run of the same SHA) when a fresh-CARGO_HOME baseline `cargo build` could not connect to static.crates.io. Cargo classifies that error as spurious, but its default net.retry of 3 gives up after ~12s, and SOCKET_PATCH_CARGO_E2E_REQUIRED turns the failed fixture build into a failed leg. In the merge queue the same blip evicts an entry. Set CARGO_NET_RETRY=10 (~80s of cargo's own backoff) on the children of cargo_e2e_matrix::cargo_command when the leg is required and the caller has not set CARGO_NET_RETRY. Optional local runs keep the default so an offline machine still skips quickly. Only transfers cargo itself treats as transient are retried; checksum and resolver failures still fail at once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTcGpX2RVXH9BXATkDJLdm
|
bugbot run Generated by Claude Code |
|
bugbot run Generated by Claude Code |
1 similar comment
|
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 641708e. Configure here.
|
Ready for review at
Generated by Claude Code |
Final review briefWhat it does: On required cargo e2e legs ( Risk: low. Test harness only, and gated on required legs. It adds one env var and removes nothing, so hermetic scrubbing and the Look here:
Verified:
Changes I made: none. Open questions (non-blocking): a silently dropped connection could now take several minutes per transfer (11 tries x the 30s Auto-merge (squash) is armed, so approving sends it straight to the merge queue. Generated by Claude Code |
Problem
The
cargo 1.93.1 lock-v4 (ubuntu-latest)leg (cargo-vex-matrix, which runs on PRs and in the merge queue) failed on PR #1449, run 38307581268 attempt 1. It passed when the same SHA was re-run. The failing test wase2e_vendor_cargo_build::cargo_rollback_after_agent_to_vendored_restores_cache_behind_cargo_vendor_dir, in its baseline fixture build:Each of the ~120 tests in these suites does a fresh-
CARGO_HOMEfetch from crates.io. A short network blip fails the leg, and in the merge queue it would evict the entry and cost a full rebuild.Root cause
Cargo treats a connect failure as spurious and retries it, but the default
net.retry = 3gives up after about 12s. The test took 13s. A blip longer than that fails the build. WithREQUIRED=1set, the harness turns that failed build into a hard failure.Fix
cargo_e2e_matrix::cargo_commandis the one helper every real-cargo suite uses (e2e_redirect_cargo_build,e2e_redirect_cargo_shapes,e2e_vendor_cargo_build,mode_migration_cargo,e2e_safety_cargo_build). When the leg is required, it now setsCARGO_NET_RETRY=10on its children, which gives about 80s of cargo's own backoff. An ambientCARGO_NET_RETRYstill wins. Optional local runs keep the default, so an offline machine still skips quickly. Only errors cargo itself classifies as transient are retried. Checksum, resolver and--lockedfailures still fail immediately.The one test that needs a fast network failure (the old-cargo
127.0.0.1:9proxy check ine2e_vendor_cargo_build.rs) builds its ownCommandwithCARGO_NET_RETRY=0, so it is unaffected.Proof
cargo fetchof cfg-if through a refused proxy (the same[7] Could not connect ... after 0 mserror): retry=3 fails after 12s (3 spurious warnings). retry=10 fails after 80s.Downloaded cfg-if v1.0.5).SOCKET_PATCH_CARGO_E2E_REQUIRED=1 cargo test -p socket-patch-cli --test e2e_redirect_cargo_build --test e2e_redirect_cargo_shapes --test e2e_vendor_cargo_build --test mode_migration_cargo: 22 + 31 + 39 + 29 passed.rustfmt --checkis clean on the touched file. Clippy (-D warnings) reports nothing in the touched file. The same targets already fail clippy on unmodified main intests/common/mod.rsandtests/prebuilt_common/mod.rs(11 errors either way).No tests removed or moved.
Not covered: a 2-minute runner DNS outage (main push run 38182319501,
rustup toolchain install stablefailed 4 times onTemporary failure in name resolution). That is runner infrastructure, and no retry window here is meant to absorb it.🤖 Generated with Claude Code
https://claude.ai/code/session_01GTcGpX2RVXH9BXATkDJLdm
Note
Low Risk
Test-harness-only change to env vars on spawned
cargoprocesses; no production runtime or security impact.Overview
Required cargo e2e legs now set
CARGO_NET_RETRY=10on childcargoinvocations (via sharedcargo_e2e_matrix::cargo_command) so transient crates.io connect failures get ~80s of Cargo’s built-in backoff instead of the default ~12s, which was flaking CI whenSOCKET_PATCH_CARGO_E2E_REQUIREDforbids skips.An explicit ambient
CARGO_NET_RETRYstill wins; optional local runs keep Cargo’s default for fast offline skips. A newREQUIRED_NET_RETRYconstant and expanded helper docs describe the behavior.Reviewed by Cursor Bugbot for commit 641708e. Configure here.
Generated by Claude Code