GeezerVison is showing github.com — Skip cargo shapes on a failed --precise pin, with cargo stderr by mikolalysenko · Pull Request #1666 · SocketDev/socket-patch
Conversation
Problem
test-release (2) failed in the full-scope run 39745825228 (job 119714465566). That run made ci-ok red for #1663's head. The failing test was cargo_hosted_refuses_a_lockless_project_with_other_dependencies, and the message gave no cause:
panicked at crates/socket-patch-cli/tests/e2e_redirect_cargo_shapes.rs:977:9:
cannot lock [email protected]:
<the generated Cargo.lock, with cfg-if 1.0.5>
The project has no lockfile, so generate-lockfile resolves the newest cfg-if (1.0.5). pin_patched_versions then runs cargo update -p [email protected] --precise 1.0.4. That command returned non-zero, but its stderr was dropped. The pin works fine locally, and the full suite passes (33/33). So the likely cause is a transient index fetch in the fresh CARGO_HOME, the same blip class as #1459 and #1654. The log can't confirm it.
The same suite runs in coverage, which gates ci-ok and the merge queue. There, one such blip during fixture setup evicts the queue entry.
Root cause
Fixture setup already soft-skips when cargo can't reach crates.io: a failed generate-lockfile and a failed baseline cargo build both go through cargo_e2e_matrix::skip. The --precise pin is the same kind of network-dependent setup step, but it hard-asserted and dropped cargo's error.
Fix
pin_patched_versions now returns Err carrying each failed cargo update's stderr, and run_shape passes that to cargo_e2e_matrix::skip:
- Optional legs (
coverage, test-release) skip, with the cause printed.
- The required
lock-v* legs (SOCKET_PATCH_CARGO_E2E_REQUIRED=1, ci.yml:2397-2410, which run this suite) still fail on it. The panic now includes cargo's error.
This complements #1654, which widens CARGO_NET_RETRY under CI. That change makes blips rarer; this one makes a remaining blip skip on optional legs and makes any failure readable. The two PRs touch different files.
Proof
cargo test -p socket-patch-cli --test e2e_redirect_cargo_shapes: 33 passed.
- A
cargo shim on PATH that fails only update with a simulated download error:
- Optional mode:
SKIP e2e_redirect_cargo_shapes (lockless-other-dependencies): cannot lock [email protected] (crates.io unreachable?): \cargo update -p [email protected]`: error: failed to download ... (simulated blip)`, and the test passes as a skip.
SOCKET_PATCH_CARGO_E2E_REQUIRED=1: the test panics with the same text plus (and SOCKET_PATCH_CARGO_E2E_REQUIRED is set, so this leg must not skip).
rustfmt was run on the touched file. cargo clippy -p socket-patch-cli --test e2e_redirect_cargo_shapes -- -D warnings is clean.
No tests were removed or moved. Every shape still runs everywhere it ran before.
https://claude.ai/code/session_01WKXDFSSDxDgdAGiUGLKWQB
Generated by Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
pin_patched_versions asserted when `cargo update --precise` failed and
dropped cargo's stderr, so a crates.io blip during fixture setup failed
the suite with only "cannot lock [email protected]" and the lock text (seen
in test-release (2) of run 39745825228). generate-lockfile and the
baseline build already soft-skip on the same class of failure.
Return the failure with each `cargo update` stderr instead and route it
through cargo_e2e_matrix::skip: optional legs (coverage, test-release)
skip with the cause printed, while the required lock-v* legs still fail
on it, now with cargo's error in the panic.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WKXDFSSDxDgdAGiUGLKWQB
cursor[bot] reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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 07c2698. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Labeled Ready for review at 07c26982666de3666ff43691d712c2fec343482f.
- CI: 35/35 green, 19 skipped (
ci-ok success). No main-wide failures.
- Bugbot: reviewed
07c2698, no findings.
- Reviewer note: one test file only (
e2e_redirect_cargo_shapes.rs). A failed cargo update --precise during fixture setup now skips on optional legs with cargo's stderr; required lock-v* legs still fail on it.
- Slack not announced: no Slack send tool was available in this run.
Generated by Claude Code
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Final review brief
What it does. Test-only change. In the cargo "shapes" e2e suite, a failed cargo update --precise during fixture setup used to hard-assert and throw away cargo's stderr. Now it returns the error with cargo's stderr and goes through the existing cargo_e2e_matrix::skip. Optional legs (coverage, test-release) skip with the cause printed. Required lock-v* legs still fail, and their failure now says why.
Risk: low. One test file. No product code changes. It reuses the skip path that generate-lockfile and the baseline build already take, so required legs keep full coverage.
Look here
crates/socket-patch-cli/tests/e2e_redirect_cargo_shapes.rs#L466-L469:`` the new skip on a pin error, the same as the neighbouring call sites at L457 and L479.
crates/socket-patch-cli/tests/e2e_redirect_cargo_shapes.rs#L955:``` pin_patched_versions now returns `Result`.
crates/socket-patch-cli/tests/e2e_redirect_cargo_shapes.rs#L981-L992:```` stderr from each failed attempt is collected and returned only when no candidate pinned.
Verified
- Read the full diff and the description, which matches the code.
cargo_e2e_matrix::skip is used the same way (let _ =) at the other two setup-skip sites.
stderr() is the file's existing helper (L172).
.any() still short-circuits on the first successful pin.
- Scope is one file. No debug leftovers.
CHANGELOG.md is untouched.
- CI on
07c26982f1c4: 35/35 green (19 skipped by design). Bugbot: success.
- Not re-run locally: the suite needs crates.io. The author's shim proof is in the description.
Changes I made: none.
Open questions: none blocking. One nit: when several candidates fail, their stderr strings are joined without a separator. This affects only the readability of a rare message.
Auto-merge is armed, so approving sends this straight to the merge queue.
Generated by Claude Code
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
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
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|