test: run freshly written stand-in executables once before relying on them - #317
Merged
Merged
Conversation
… them Three tests write a shell script and run it at once: git_pending's fake git, git_pending_fast_path's hanging git and cli_ui's stand-in browser. When another thread of the same test binary forks while the script is still open for writing, the child keeps the inherited descriptor until it execs, and running the script meanwhile fails with ETXTBSY. Main's Coverage job on 81bd7c7 failed that way: `git` read the failed start as a failed git and conversion_risk returned None. The hanging-git test could pass the same way without its timeout ever running. Each helper now starts the script once, retrying while the error is ExecutableFileBusy. Once a start succeeds no writer is left, so the test's own runs cannot hit it. The hanging git uses `exec sleep 30`, so stopping it leaves no orphan, and the test checks that the timeout actually elapsed.
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (63.15%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## main #317 +/- ##
==========================================
- Coverage 95.07% 95.07% -0.01%
==========================================
Files 198 198
Lines 109014 109033 +19
==========================================
+ Hits 103647 103659 +12
- Misses 5367 5374 +7
🚀 New features to boost your workflow:
|
sunerpy
added a commit
that referenced
this pull request
Oct 3, 2026
The release record for #314: the release PR merge and its tag SHA, the workflow run, the published digest, and the black-box acceptance against v0.53.2, plus dated entries for the padded kind column and for the stand-in executable warm-up in #317. Current alignment lists v0.53.3. Co-authored-by: CodeGraph Test <codegraph@example.invalid>
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.
Summary
Main's Coverage job on
81bd7c7(run 37143381765) failed once ingit_pending::tests::a_system_attributes_file_is_a_conversion_risk:left: None,right: Some(false). The cause isan
ETXTBSYrace in the test helper, not inconversion_risk. The Coverage job is informational, and the requiredCI Successpassed.The race:
gitshell script and runs it at once.inherited descriptor until it execs.
ETXTBSY("Text file busy").git()maps a failed start toNone, soconversion_riskreturnedNone.Two other tests share the pattern:
git_pending_fast_path's hanging git. A failed start declines exactly the way the timeout does, so the test couldpass without its timeout ever running.
cli_ui's stand-in browser. Ifcodegraph uicould not start it, the test would fail.Each helper now starts the freshly written script once, retrying while the error is
io::ErrorKind::ExecutableFileBusy. Once a start succeeds no writer is left, so the test's own runs cannot hit it.exec sleep 30, so stopping it leaves no orphan.Verification
/bin/truewhile the mainthread writes 3,000 fresh scripts and runs each at once. 313 of the 3,000 fail to start with
ETXTBSY.followed had 0
ETXTBSY.codegraph-watchlibgit_pending(1),--test git_pending_fast_path(27), andcodegraph-rs --test cli_ui(15).make pre-ci) passed on this head: all Rust tests, 569 frontend tests, docs-check, clippy-D warningswith all features, and the archive smoke.🤖 Generated with Claude Code