Repository navigation
Remove Scenario fixture roots after killed test harnesses - #2117
Merged
Merged
Conversation
Merged
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
Closes #2093. Give each Scenario root a directory guardian that survives harness-only and process-group SIGKILL. Previously, Run guardians ended descendants but only the killed harness's
TempDircould remove the fixture.Preserve process-only
OwnedRunscallers. Document the contract indocs/testing.mdand verify normal completion, assertion unwinding, both SIGKILL patterns, and concurrent Scenarios.Evidence
Execution evidence
cargo test --locked --test scenario_lifetime -- --nocapturewith the new root-absence assertion, before implementation:After:
cargo test --locked --test scenario_lifetime -- --nocapture:cargo check --locked --test quota_waitinitially failed with E0061 attests/quota_wait.rs:309; preservingOwnedRuns::new()and attaching directory ownership separately makes the exact command pass.cargo test --locked --test scenario_lifetime --test quota_waitpasses 7 lifecycle tests and 8 quota tests.cargo test --locked --test console codex_patches:: -- --test-threads=8failed before bounded removal retries (Directory not empty, 5 passed / 1 failed), then passed all 6 tests after the correction. Transient missing entries count as success only when the captured root is absent.RUST_TEST_THREADS=3 scripts/affected-tests main— PASS: 4,418 tests passed, 0 failed, 197 ignored subprocess/platform cases across 108 targets. The selector'scargo testfallback took 2,548.68 seconds, including compilation. The thread limit followsdocs/testing.mdfor loaded hosts; a Console scoring assertion in the initial default-parallel run passed alone, and all 321 Console tests passed with three threads. Full output is retained in.affected-tests/cargo-test-af3t1fuw.logbeside the Session evidence.6b41029c, including all four Rust x86 partitions and their coverage gate, site, and Console browser tests.Seams under test: the Scenario's observable root and owned process lifetime, exercised through
Scenario::new,run,run_until, and drop in separately supervised harnesses. The supervisor records exact PIDs and the exact root, reaps the directory guardian, and asserts root absence before its emergency-cleanup TempDir is dropped. The concurrency case drops one Scenario while another remains usable.Confirmed cause: SIGKILL bypasses
TempDir::drop. The new exec'd directory guardian has its own process group and waits for EOF on a private close-on-exec pipe held by the harness and every Run guardian, ordering directory removal after descendant cleanup.Review coverage
Standards: 0 findings. Spec: 1 finding, fixed and verified with the reviewer's exact command. Both axes read all four changed files; no changed file was left unread, and no generated output was excluded. Reports and counts are retained in
.thirdshift-review-dYuGzK/beside the Session evidence.Unaddressed findings
Standards
None.
Spec
None. The constructor finding was addressed; no findings were skipped.
Security
None.
Security review outcome
No unaddressed introduced findings.
Merge Danger
Door: two-way
Revert the test-infrastructure changes to restore the previous lifetime behavior.
Blast Radius: tests
Each Scenario starts one extra cleanup process. Deletion is confined to its explicitly captured fixture root; no historical directory cleanup or generic temporary-directory sweeping is added.
Built with codex codex-cli 0.167.2 · gpt-6.1-sol · xhigh