Repository navigation
Fix Windows flake in gem global-gemfile refusal e2e - #1169
Merged
Mikola Lysenko (mikolalysenko) merged 1 commit intoOct 8, 2026
Merged
Conversation
gem_hosted_global_gemfile_setting_is_refused only reached the redirect stage because the scan found the host's globally installed gems via `gem env`: the refused lock contributes no packages, so without an installed package no batch call fires and the refusal never runs. On Windows runners `gem env` sometimes outlives the 10s probe budget. The scan then reports scannedPackages: 0 and the test fails. This evicted two merge-queue entries on 2026-10-08 (#1147 and one at 17:31 UTC). Lay the gem down in the project with materialize_installed_gem, as the other tests in this file do, so the test no longer depends on the host's Ruby install. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xr7gMxM5ugBStCpk6kJ3V4
Collaborator
Author
|
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 818923f. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 8, 2026
Collaborator
Author
|
Burn-down agent: labeled Ready for review at 818923f.
Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
deleted the
ci-janitor/gem-global-gemfile-hermetic
branch
October 8, 2026 22:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
gem_hosted_global_gemfile_setting_is_refused(crates/socket-patch-cli/tests/e2e_redirect_gem_stale_install.rs) fails now and then on thetest (windows-latest, 2)leg. It caused 2 merge-queue evictions on 2026-10-08:Neither PR touches gem code. Both failures have the same signature:
In the second failure the test ran for about 10.8s (20:19:53 to 20:20:04). Every other test in the binary finished in under a second.
Root cause
The test writes a
Gemfile/Gemfile.lockpair plus a globalBUNDLE_GEMFILE: Gemfile.next. The scan correctly refuses the lock (gem_lock_unsupported), so the lock contributes no packages. The scan only got as far as the batch call, the redirect stage and theredirect_gem_bundle_gemfile_unsupportedrefusal because it found the host's globally installed gems throughgem env gemdir/gempath. Locally on Linux that givesscannedPackages: 17, all of them system gems.On Windows runners,
gem env(agem.cmdshim starting Ruby) sometimes takes longer thanPROBE_TIMEOUT(10s,utils/process.rs). When that happens the scan finds 0 packages, makes no batch call and runs no redirect, so the expected warning never appears. The test was quietly depending on how fast the CI runner's Ruby install starts.Fix
Lay the gem down in the project's bundler deployment layout with the existing
materialize_installed_gemhelper, as the other tests in this file already do. The scan then findsstale-probe-gemwithout asking the host. The production code path is unchanged. Every assertion is unchanged: refusal code and detail,redirected == 0, Gemfile and lock byte-identical, nothing attested, non-zero exit.Proof
gemfrom the child process:PATH=/nonexistenton the test binary, on origin/main. Result:FAILED, with the samescannedPackages:0/ emptyredirect.warningsenvelope as on CI.PATH=/nonexistent(nogem) and 100/100 passes with the normal PATH.e2e_redirect_gem_stale_installbinary passes (37/37).rustfmt --checkon the touched file passes, and so doescargo clippy -p socket-patch-cli --test e2e_redirect_gem_stale_install -- -D warnings.No tests were removed or moved; the test still runs in the same
test (*)legs.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xr7gMxM5ugBStCpk6kJ3V4
Generated by Claude Code