Skip to content

watch: exit on SIGINT when a custom signal handler drains the event loop - #32405

Open
robobun wants to merge 8 commits into
mainfrom
farm/caed0ad3/watch-sigint-exit
Open

watch: exit on SIGINT when a custom signal handler drains the event loop#32405
robobun wants to merge 8 commits into
mainfrom
farm/caed0ad3/watch-sigint-exit

test: surface stderr on unclean exit in the watch SIGINT test

1161be0
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 16, 2026 in 21m 41s

Code review found 1 important issue

Found 3 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/runtime/cli/run_command.rs:1581-1583 bun test --watch sibling loop has the same SIGINT hang

Annotations

Check failure on line 1583 in src/runtime/cli/run_command.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

bun test --watch sibling loop has the same SIGINT hang

`bun test --watch` has the same SIGINT hang at a structurally-identical sibling loop — `run_event_loop_for_watch()` in `src/runtime/cli/test_command.rs:2965-2976` — which is left unfixed. A test/preload file that installs `process.on("SIGINT", ...)` and drains the loop will leave `bun test --watch` stuck in `tick_possibly_forever()` after Ctrl+C. Per CLAUDE.md ("Fix the whole class in the same PR — grep for every sibling site sharing the pattern"), the same `if vm.termination_signal_requested()