Skip to content

Harden Unix process-group cancellation tests - #956

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-killpg-maple
Sep 16, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-killpg-maple

Conversation

@AnthonyRonning

Copy link
Copy Markdown
Contributor

Summary

shell_cancellation_kills_the_unix_process_group flakes on Agent macOS CI (cancelled descendant survived process-group termination). The test cancelled after a blind 100ms while the descendant did sleep 1 before writing a sentinel, so a loaded parallel cargo test could let the write happen before process-group kill.

This copies the handshake already used by aborting_the_shell_task_kills_its_unix_process_group: fork the descendant first, write a started marker, wait for that marker, then cancel/revoke. The same pattern is applied to tool_context_revocation_kills_the_unix_process_group. Production shell code is unchanged.

Test plan

  • cargo test -p maple-agent --locked --lib unix_process_group five times
  • just fmt-check and just clippy in apps/maple-agent
  • Agent CI macOS job

These tests cancelled after a blind 100ms while the descendant slept 1s,
so a loaded cargo test run could let the sentinel file be written before
killpg. Wait until the background job is actually running, then cancel.
@AnthonyRonning
AnthonyRonning merged commit 858513f into master Sep 16, 2026
27 checks passed
@AnthonyRonning
AnthonyRonning deleted the codex-killpg-maple branch September 16, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant