Skip to content

test(cli): make dispatch cancellation handshake deterministic - #2500

Closed
wgqqqqq wants to merge 1 commit into
GCWing:mainfrom
wgqqqqq:codex/fix-macos-cli-cancellation-test
Closed

test(cli): make dispatch cancellation handshake deterministic#2500
wgqqqqq wants to merge 1 commit into
GCWing:mainfrom
wgqqqqq:codex/fix-macos-cli-cancellation-test

Conversation

@wgqqqqq

@wgqqqqq wgqqqqq commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • keep the test leader blocked in the shell builtin wait
  • let SIGTERM run the exit trap immediately instead of waiting on an external sleep
  • preserve the TERM-resistant child that verifies SIGKILL is not sent after leader exit

Why

The macOS CLI job in #2495 intermittently failed cancellation_does_not_escalate_after_term_exits_the_verified_leader. Under load, /bin/sh can defer a trapped signal while waiting for an external foreground command, so the test leader sometimes survived the one-second TERM grace window and was legitimately escalated.

Verification

  • target test: 50/50 repeated passes on macOS
  • all 6 dispatch::runner tests pass
  • cargo check -p bitfun-cli
  • cargo test -p bitfun-cli (685 unit tests plus CLI integration suites)

Only the test fixture changes; production cancellation behavior is unchanged.

@wgqqqqq

wgqqqqq commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by the root-cause production fix merged in #2497. That change rejects macOS process states carrying the exiting E modifier before SIGKILL escalation; this test-fixture-only PR is no longer the right fix.

@wgqqqqq wgqqqqq closed this Aug 25, 2026
@wgqqqqq
wgqqqqq deleted the codex/fix-macos-cli-cancellation-test branch August 25, 2026 13:27
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