fix(test): confine the RLIMIT_FSIZE atomic-write repro to a child process - #227
Merged
Mikola Lysenko (mikolalysenko) merged 1 commit intoAug 21, 2026
Merged
Conversation
…cess atomic_write_failed_stage_write_errors_and_keeps_target (from #223) capped RLIMIT_FSIZE to 256 KiB and ignored SIGXFSZ PROCESS-WIDE for its window. #[serial] only serializes against other #[serial] tests, so every concurrently-running sibling test — and the libtest harness itself — that wrote a file larger than the cap died with EFBIG, aborting the whole core lib binary: observed as `cargo test --workspace` exiting 101 with ZERO failed tests and `io error when listing tests: … FileTooLarge` (reproduced 3/3 on this machine; the binary passes solo). The sizes cannot simply be raised out of siblings' range: the payload must fit tokio's single 2 MiB write chunk or write_all surfaces the error directly and the swallowed-sync_all path the test pins is never exercised. Instead the parent re-execs the test binary filtered (--exact) to this one test with a marker env var selecting the capped body, confining the blast radius to a single-test child process. An anti-vacuity assert on the child's "1 passed" summary keeps a future rename from silently turning the child run into a filter-matches-nothing no-op. Validated: the test still goes RED when the guarded bug is reintroduced (flush() removed → child fails → parent fails); cargo test --workspace 0/3 green before the fix, 2/2 green after; core lib 2526/2526. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wenxin Jiang (Wenxin-Jiang)
approved these changes
Aug 21, 2026
Mikola Lysenko (mikolalysenko)
deleted the
fix/fsize-rlimit-test-isolation
branch
August 21, 2026 01:35
Mikola Lysenko (mikolalysenko)
added a commit
that referenced
this pull request
Aug 21, 2026
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.
What
cargo test --workspaceintermittently (on this machine: reliably) exits 101 with zero failed tests:utils/fs.rs'satomic_write_failed_stage_write_errors_and_keeps_target(added in #223) capsRLIMIT_FSIZEto 256 KiB and ignoresSIGXFSZprocess-wide during its window.#[serial]only serializes against other#[serial]tests — every concurrently-running sibling test, and the libtest harness itself (io error when listing tests: … FileTooLarge), that wrote >256 KiB during the window died with EFBIG and aborted the whole core-lib binary mid-run.Why not just resize
The payload must stay within tokio's single 2 MiB write chunk: the bug this test pins is
write_allbuffering the whole payload and returning Ok before the background write hits EFBIG, withsync_allstoring the error instead of returning it. A multi-chunk payload surfaces the error directly and stops exercising the swallowed-error path — so the cap can't be raised out of siblings' reach.How
The parent arm re-execs the test binary filtered (
--exact) to this one test with a marker env var selecting the capped body — the rlimit's blast radius is now a single-test child process. An anti-vacuity assert on the child's1 passedsummary keeps a future rename from turning the child run into a filter-matches-nothing no-op.Validation
flush()) fails the confined test; restoring it passes.cargo test --workspace: 0/3 green before the fix → 2/2 green after on the machine that reproduced it;-p socket-patch-core --lib2526/2526.🤖 Generated with Claude Code
Note
Low Risk
Test-only isolation of an existing Unix regression; production atomic-write code is unchanged.
Overview
Stops
cargo test --workspacefrom aborting with exit 101 and zero failed tests when the Unix atomic-write EFBIG regression test is running.atomic_write_failed_stage_write_errors_and_keeps_targetstill capsRLIMIT_FSIZE(and ignoresSIGXFSZ) to pin the swallowed-sync_allpath, but that cap is now applied only in a re-exec’d child filtered to this one test.#[serial]is dropped because it never protected concurrent non-serial siblings or the harness. The parent asserts child success and that stdout contains1 passedso a rename cannot make the filter a no-op.Reviewed by Cursor Bugbot for commit 183eaed. Configure here.