Repository navigation
fix(fleet): place the fake gh with cp so parallel forks can't ETXTBSY it (#11834) - #11897
Conversation
fake_gh wrote the script with std::fs::write in the test process. Tests run on parallel threads, and a thread that forks to spawn a child holds a copy of every open descriptor until its exec, including the one the script was being written through. Exec'ing the script inside that window fails with ETXTBSY, which fleet-smoke hit under the Nix build sandbox (#11834). The text now goes to a side file and a separate `cp` process writes the executable, so this process never has it open for writing. raw_mode_runs_gh_without_token also compared the logged token with "", which assumes the runner has no GH_TOKEN of its own; it now expects the ambient value passed through untouched, which is what raw mode does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
Before:
gh::tests::raw_mode_runs_gh_without_tokencould fail withText file busy (os error 26)and exit 3, as it did in fleet-smoke run 44347324734 (#11834). The fakeghwas written by the test process itself, so a parallel test thread that forked at the wrong moment held a writable descriptor to it while another test exec'd it. Separately, the same test failed on any runner that carries its ownGH_TOKEN, since it expected an empty token in the log.After: the fake
ghis placed by a short-livedcpprocess from a side file, so the test process never holds it open for writing and no fork can make it busy. The raw-mode test expects the ambientGH_TOKEN(empty when none) to pass through untouched, which is the raw-mode contract: no token injected.How:
fake_ghinpkgs/fleet/crates/fleet/src/gh.rswritesfake-gh.src, runscptofake-gh, then chmods it. Ran the fleet bin tests 5× with no token and once with one; all 62 pass. Leaves the ONNX fetch part of #11834 alone, which was already triaged as infrastructure.Generated by Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit