Skip to content

test(signals): wait for wt receipt before alias child exits - #4607

Closed
worktrunk-bot wants to merge 1 commit into
mainfrom
fix/ci-40431059522
Closed

worktrunk-bot wants to merge 1 commit into
mainfrom
fix/ci-40431059522

Conversation

@worktrunk-bot

Copy link
Copy Markdown
Collaborator

The final-alias Ctrl-C test could let its shell exit before the group SIGINT reached wt. At that point wt was idle, so the late signal ended it even though the alias child had exited successfully. Keep the shell alive until wt records receiving SIGINT, then assert the child's successful exit is preserved. The debug trace now records foreground signal receipt to make that synchronization observable.

This reproduces the failed Linux run and the recurrences tracked in #4603. Locally, the original test failed on focused iteration 31; with exit diagnostics it failed on iteration 773 with wt terminated by SIGINT after the trace logged the alias child as successful. The synchronized test passed 500 focused runs, then 100 more on the latest main. The failed CI job passed on rerun.

Fixes #4603.

@worktrunk-bot worktrunk-bot added the automated-fix Automated CI fix label Oct 27, 2026
max-sixty added a commit that referenced this pull request Oct 27, 2026
A final alias child can catch Ctrl-C and exit successfully before wt's
signal-owning thread finishes handling its SIGINT. Retiring the final
foreground scope on another thread can restore idle default handling
during that receipt, killing wt instead of preserving the child's exit
status.

Retire foreground scopes on the existing process owner, which already
serializes signal receipt with child admission. Add a controlled
regression that pauses receipt while a real child handles Ctrl-C and
exits successfully, cover nested owner requests and panic propagation,
and preserve exit status and stderr in the alias test's failure
diagnostic.

Includes the receipt handshake from
[#4607](#4607): the alias
test keeps its child alive until wt records receiving SIGINT. This
separates an interrupt received during the command from one that arrives
after the child has exited. The controlled unit regression independently
exercises teardown during an already-entered handler.

The regression fails against main and passes with the fix on Linux and
macOS. Validation: full project gate (5,442 tests passed, one skipped),
Linux signal/process-owner tests, and all 91 Linux alias tests.

Fixes #4603.

> _This was written by Codex on behalf of max-sixty_

---------

Co-authored-by: worktrunk-bot <[email protected]>
@max-sixty

Copy link
Copy Markdown
Owner

The signal receipt trace and alias handshake were incorporated into merged #4609, together with the separate foreground-retirement repair and regression test. This PR's changes are now on main, so closing it as completed.

This was written by Codex on behalf of max-sixty

@max-sixty max-sixty closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated-fix Automated CI fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci-fix: Linux signal alias test intermittently exits unsuccessfully

2 participants