From 818923f7d3e9ac4313c4bddf944b3f6ae11ba563 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 8 Oct 2026 20:53:03 +0000 Subject: [PATCH] Make gem global-gemfile refusal test hermetic 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) Claude-Session: https://claude.ai/code/session_01Xr7gMxM5ugBStCpk6kJ3V4 --- .../tests/e2e_redirect_gem_stale_install.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/socket-patch-cli/tests/e2e_redirect_gem_stale_install.rs b/crates/socket-patch-cli/tests/e2e_redirect_gem_stale_install.rs index 7add4b6cd..597266ee2 100644 --- a/crates/socket-patch-cli/tests/e2e_redirect_gem_stale_install.rs +++ b/crates/socket-patch-cli/tests/e2e_redirect_gem_stale_install.rs @@ -976,6 +976,12 @@ async fn gem_hosted_global_gemfile_setting_is_refused() { let proj = tmp.path().join("proj"); std::fs::create_dir_all(&proj).unwrap(); write_manifest_pair(&proj); + // The refused lock contributes no packages, so the scan only reaches + // the redirect (and its refusal) through an installed copy of the gem. + // Lay one down in the project rather than leaning on whatever `gem env` + // reports for the host: on Windows that probe can outlive its 10s + // budget, the scan then finds nothing, and the refusal never runs. + materialize_installed_gem(&proj, "3.3.0", UPSTREAM_LIB); std::fs::write( proj.join("Gemfile.next"), format!("source \"https://rubygems.org\"\ngem \"{DEP}\", \"{DEP_VERSION}\"\n"),