Repository navigation
test(cli): isolate closed stdout assertions - #526
Conversation
Signed-off-by: Gunwoo Kim <gunwooterry@gmail.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Review: no blocking issue Reviewed head Same behaviour proved. The probe body below the new guard is byte-for-byte the old test: the same command matrix ( Isolation cannot mask a regression. The CLI exiting 0 or writing to stderr fails an assertion in the child, the child exits non-zero, and the parent's CI runs it by name. Non-blocking:
CodeRabbit had no inline findings when this was posted (still running). CodeRabbit: 0 confirmed, 0 minor, 0 false positive |
TL;DR
Tier: internal
Background
The macOS merge-queue check intermittently observed exit 0 instead of 141 on a closed stdout pipe. Another test thread can spawn a process while the pipe reader is briefly inheritable, leaving a reader alive after the test drops its own handle. Small writes then succeed legitimately.
What changes
CLI and library behavior are unchanged.
After merging: None.
Decisions
Evidence
Verification run: On macOS arm64, 100 unmodified CLI-suite loops with
--test-threads=32passed the target test. With temporary instrumentation spawning/bin/sleep 0.01continuously from 16 parent threads, the original assertion failed 9/500 times, always with exit 0 instead of 141. With isolation and the same parent spawn pressure, 0/500 failed. Pressure instrumentation is not included in this PR.A separate 100,000-pipe diagnostic accepted 19 writes after dropping the local reader during concurrent spawns. Every affected pipe returned
BrokenPipeonce the spawned children exited. With no concurrent spawns, 0/100,000 writes succeeded.Local checks passed:
cargo fmt --all --check,cargo clippy -p coreav-cli --test cli -- -D warnings,cargo test -p coreav-cli --test cli -- --test-threads=32with 67 passed and 7 ignored, another 100/100 complete uninstrumented CLI-suite loops at the committed head,cargo deny --all-features check, all 31 fuzz-project license checks, workflow and public-text self-tests.At this head, the Linux check and macOS check both logged
test a_closed_standard_output_exits_141_quietly ... ok. Their CLI suites finished with 68 passed and 7 ignored on Linux, and 67 passed and 7 ignored on macOS.Similarity passed at
317f8048adaddd039a02e155fb31594fbf858f88against the main allowlist:110 spans of 50+ tokens, 0 not allowlisted, 0 problems, 1 stale entrieswith stale entries reported rather than failed.Links: None.
git commit -s, DCO).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.