Repository navigation
fix(test): stop executable fixtures racing ETXTBSY under parallel tests - #487
Conversation
`provers::chuffed::tests::version_rejects_failed_empty_or_stderr_only_help` failed in CI with "Failed to execute fzn-chuffed --help: Text file busy (os error 26)". The fixtures wrote a script and executed it at once. A fork on another test thread, taken while the write descriptor was open, keeps a copy until that child execs, and the kernel refuses to execute a file with a writer. New provers::test_fixture::write_executable creates the script with mode 0700, closes it, then runs it with a sentinel argument until the kernel accepts the exec. After one successful exec no writer remains and no later fork can inherit one. The chuffed, faial, gpuverify and version_probe fixtures use it; each fixture exits 64 on an unexpected argument, so the probe runs no fixture body. Also carries the rustfmt fix to proof_search.rs from #465, identical to it, so `cargo fmt --check` is green here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Codex Review Summary: ❌ FailedThis 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. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79de6d11f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review on #487: OpenOptions::mode is filtered by the process umask, so a restrictive umask could leave the fixture non-executable. Restore the explicit set_permissions(0o700) after closing the writer and before the readiness probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3
| Err(error) if error.kind() == ErrorKind::ExecutableFileBusy => { | ||
| std::thread::sleep(Duration::from_millis(10)); | ||
| }, | ||
| Err(error) => panic!("fixture executable cannot run: {error}"), |
| .create_new(true) | ||
| .mode(0o700) | ||
| .open(path) | ||
| .expect("create fixture executable"); |
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
|



Problem
rust-ci / Cargo testfailed intermittently with:It failed on #470, whose diff contains no Rust, and earlier in llvm-cov. The cause is a real race, not a flake. Four fixtures (chuffed, faial, gpuverify and version_probe) each write a shell script and execute it at once. If another test thread forks while the write descriptor is still open, the child keeps a copy of it until it reaches
exec(Rust opens files close-on-exec). While any writer exists, the kernel refuses to execute the file withETXTBSY.Fix
New test-only helper,
provers::test_fixture::write_executable(cfg(all(test, unix))). It:0700and closes it;exec(up to 2 s, then it panics).After one successful
exec, no writer remains and no later fork can inherit one, so the test's own spawn cannot hitETXTBSY. Every fixture script exits 64 on an unexpected argument, so the probe never runs a fixture body. The four fixtures now use the helper.The PR also carries #465's rustfmt fix to
proof_search.rs, byte-identical to it, socargo fmt --checkis green here as well.Checks run locally
cargo test --lib -- provers::chuffed provers::faial provers::gpuverify provers::version_probe: 58 passed.cargo clippy --lib --tests -- -D warnings: clean.cargo fmt --check: clean.Once this is open, I'll port it into the open PRs that hit the race (starting with #470).
Generated by Claude Code