From 317f8048adaddd039a02e155fb31594fbf858f88 Mon Sep 17 00:00:00 2001 From: Gunwoo Kim Date: Sun, 8 Nov 2026 17:24:33 +0900 Subject: [PATCH] test(cli): isolate closed stdout assertions Signed-off-by: Gunwoo Kim --- crates/coreav-cli/tests/cli.rs | 21 +++++++++++++++++++++ docs/agents/ci.md | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/coreav-cli/tests/cli.rs b/crates/coreav-cli/tests/cli.rs index b13a9960d..b5293ef80 100644 --- a/crates/coreav-cli/tests/cli.rs +++ b/crates/coreav-cli/tests/cli.rs @@ -2546,6 +2546,27 @@ fn media_on_standard_output_are_the_file_bytes() { #[cfg(any(unix, windows))] #[test] fn a_closed_standard_output_exits_141_quietly() { + const NAME: &str = "a_closed_standard_output_exits_141_quietly"; + if std::env::var_os("COREAV_CLI_CLOSED_READER_PROBE").is_none() { + let result = Command::new(std::env::current_exe().unwrap()) + .args([ + "--exact", + NAME, + "--nocapture", + "--color", + "never", + "--test-threads=1", + ]) + .env("COREAV_CLI_CLOSED_READER_PROBE", "1") + .output() + .unwrap(); + assert!(result.status.success(), "{result:?}"); + assert!( + String::from_utf8_lossy(&result.stdout).contains(&format!("test {NAME} ... ok")), + "{result:?}" + ); + return; + } let mut commands = succeeding_commands("stdout_pipe"); let movie = file("stdout_errors_pipe.mp4", &av_movie_with(aac_entry(), false)); let movie = movie.to_str().unwrap().to_owned(); diff --git a/docs/agents/ci.md b/docs/agents/ci.md index b73ee8a98..caec8a83d 100644 --- a/docs/agents/ci.md +++ b/docs/agents/ci.md @@ -45,7 +45,7 @@ List development caches with `docker volume ls --filter name=coreav-dev-`. After | A credentialed manual workflow that builds a dispatched commit admits only commits on this repository's branches, so pull-request code from forks never runs beside corpus credentials | The HEVC reference workflow's admission step refuses a candidate no branch contains before the build and every credentialed step; `test_candidate_must_be_on_a_branch_before_it_builds_or_sees_credentials` pins that order. Writers already hold the repository's secrets, so this closes the only path that widens access. Workflow step order cannot be encoded in Rust types | | A daily full run skips only for a successful same-workflow main-push attempt at its exact SHA; weekly full runs never skip for coverage, and a covered daily never masquerades as missing full work | `merge-group-result` owns bounded search and revalidation; `ci_full.covers` owns complete job/proof validation shared with the pinned-claim reporter. `test_full_coverage.py` rejects wrong identities, non-successes, missing legs, reruns and malformed claims, while preserving cancellation and manual evidence. An exact daily-cron gate excludes each weekly trigger; the weekly scheduling test supplies a covering success and still requires every registered full job, and the reporter test preserves the normal failure path. Workflow selection is external to Python types; weekly full work checks drift while main stays unchanged | | Merge-group reuse proves both the actual PR-tested tree and base at the newest successful run attempt; missing evidence runs the ordinary checks and advisory scans stay fresh | `merge-group-result` owns checkout-bound attempt receipts and metadata lookup. `test_merge_group_result.py` rejects wrong identities, stale or duplicate receipts, incomplete indexes, newer failures/reruns and head races; `test_main_ci_plan.py` keeps reused groups out of fixture production and main-only maintenance, retains main's baseline guard, and executes root/fuzz advisory commands and their skipped/failure witness. Workflow self-tests reject non-required merge-group triggers. Tree equality alone cannot prove changed-path selection, a base comparison or a current advisory database | -| A closed-reader stdout test cannot inherit a pipe reader through another concurrently spawned test process | `tiny_pcm_stdout_reports_a_closed_reader_during_final_flush` runs its unchanged two-byte pipe assertion in a single-test subprocess and requires the exact success witness, so zero selected tests fail. The subprocess owns pipe creation; the probe still requires exit 141 and empty stderr on every platform. A descriptor's local lifetime cannot constrain inheritance by another thread's concurrent spawn | +| A closed-reader stdout test cannot inherit a pipe reader through another concurrently spawned test process | `a_closed_standard_output_exits_141_quietly` and `tiny_pcm_stdout_reports_a_closed_reader_during_final_flush` run their unchanged pipe assertions in single-test subprocesses and require exact success witnesses, so zero selected tests fail. Each subprocess owns pipe creation; the probes still require exit 141 and empty stderr on every platform. A descriptor's local lifetime cannot constrain inheritance by another thread's concurrent spawn | | Required fixture branches consume one fresh run-bound set, H.264 smoke has exactly eight names and complete results, and full H.264 and transcode stay independent of queue reuse | `scripts/tests/test_core_ci_tiers.py` checks producer freshness on cache hits, artifact consumption without regeneration, moved command predicates, exact smoke membership and reports, full events, thread and safe-mode commands, and full-report failures. Workflow ownership is structural; types cannot govern YAML scheduling | | Full-suite reporting uses trusted main code and metadata, and final-head verification requires all three newest manual suites with complete matrix and proof-step success | `scripts/tests/test_ci_full.py` covers event and repository refusal, bot-owned issue deduplication, fixed public text, API and pagination failures, latest dispatch and attempt identity, skipped proofs, missing matrix legs, and unchanged PR heads. Live token permissions and first-merge dispatch registration remain operational checks, not test-proven claims | | VP9 routine original-file smoke and full-tier scheduling retain exact coverage | `scripts/vp9_smoke.py` owns the exact-eight selection, checksums, and completion checks. `scripts/tests/test_vp9_smoke.py` covers membership, original bytes, bounded retries, comparator execution, refusal or zero-frame failures, and closed stage/reason diagnostics without arbitrary exception arguments. `scripts/tests/test_vp9_ci_tiers.py` checks corpus events, PR and full fuzz budgets, proof-step wiring, and metadata-only reporting. Types cannot govern workflow scheduling |