test: deflake PTY SIGTERM cancellation - #699
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses flakiness in the Unix PTY runner SIGTERM cancellation test by switching from load-sensitive timing assertions to behavior-based verification (cancellation error, handler restoration, and process-tree cleanup), and updates the associated design/plan documentation for coven-047.
Changes:
- Reworks the Linux/macOS SIGTERM cancellation unit test to coordinate signal delivery with a test-only lifecycle observer and to validate durable fixture identities/cleanup.
- Adds test-only synchronization hooks in the supervised-stream cancellation guard to prevent SIGTERM delivery from racing handler restoration.
- Updates superpowers design/plan/spec/conformance documents to reflect the behavior-only contract (no “promptness” requirement).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
crates/coven-cli/src/pty_runner.rs |
Adds test-only lifecycle coordination in the cancellation guard and replaces the flaky SIGTERM PTY test with behavior/identity-based assertions plus durable cleanup. |
docs/superpowers/specs/2026-08-09-pty-sigterm-load-resilience-design.md |
New design record describing the behavior-based SIGTERM test contract and identity-safe reaping criteria. |
docs/superpowers/plans/2026-08-09-pty-sigterm-load-resilience.md |
New implementation plan describing the new synchronization/cleanup approach and validation steps. |
docs/superpowers/specs/2026-08-05-psyche-o1-1-corrective-annex-design.md |
Updates conformance language to remove “promptly” and align with expected-error semantics. |
docs/superpowers/plans/2026-08-05-psyche-o1-1-conformance-closure.md |
Updates the referenced test name and expected behavior wording to match the new contract. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+4824
to
+4848
| let mut failures = Vec::new(); | ||
| match native_stream_sigterm_fixture_states(identities) { | ||
| Ok(states) | ||
| if states | ||
| .iter() | ||
| .all(|state| *state == NativeStreamSigtermFixtureState::Reaped) => | ||
| { | ||
| return Vec::new(); | ||
| } | ||
| Ok(_) => {} | ||
| Err(error) => { | ||
| failures.push(format!( | ||
| "could not verify native stream fixture identities before cleanup: {error}" | ||
| )); | ||
| } | ||
| } | ||
|
|
||
| if let Err(error) = request_native_stream_sigterm_fixture_cleanup( | ||
| cleanup, | ||
| Instant::now() + NATIVE_STREAM_SIGTERM_TEST_WATCHDOG, | ||
| ) { | ||
| failures.push(format!( | ||
| "failed to request durable native stream fixture cleanup: {error:#}" | ||
| )); | ||
| } |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Val Alexander <68980965+BunsDev@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Validation
cargo fmt --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace --locked --exclude coven-clipython scripts/check-secrets.pypython3 scripts/check-coven-privacy.py --stagedcargo test -p coven-cli --lockedintermittently fails an unchangedmobile_memory::gateway::tests::mobile_listener_requires_pinned_tls13test with macOSEAGAIN; its exact retry passes. Remote CI is the clean-environment full-suite gate.Closes coven-047.