Skip to content

test(e2e): add ctrl-c propagation test for SIGINT handling#303

Draft
branchseer wants to merge 2 commits intomainfrom
add-ctrl-c-e2e-test-v2
Draft

test(e2e): add ctrl-c propagation test for SIGINT handling#303
branchseer wants to merge 2 commits intomainfrom
add-ctrl-c-e2e-test-v2

Conversation

@branchseer
Copy link
Copy Markdown
Member

Add a vtt exit-on-ctrlc subcommand and e2e fixture that verifies SIGINT
propagates to concurrent tasks when the user presses Ctrl+C. The test runs
two packages with vt run -r dev (using argv spawn mode), synchronizes
via milestone protocol, then sends ctrl-c and verifies both tasks handle it.

Changes:

  • vtt exit-on-ctrlc: sets up ctrl-c handler, emits "ready" milestone,
    prints "ctrl-c received" and exits on SIGINT. On Windows, clears the
    inherited CONSOLE_IGNORE_CTRL_C flag (set by an ancestor process via
    CREATE_NEW_PROCESS_GROUP) before registering the handler.
  • vt main.rs: register no-op ctrlc handler before tokio runtime so vt
    survives Ctrl+C and reports actual task exit status. Use process::exit
    to avoid Windows runtime cleanup issues.
  • ctrl-c WriteKey variant for e2e test interactions (rename_all kebab-case)
  • Fix expect_milestone to preserve unmatched milestones in a local buffer
    instead of dropping them via take_unhandled_osc_sequences
  • Strip ^C terminal echo and normalize ctrl-c received count in e2e
    redaction for cross-platform consistency
  • Fix incorrect comment in pty_terminal test about CTRL_C ignore flag source

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Copy link
Copy Markdown
Member Author

branchseer commented Mar 28, 2026

@branchseer branchseer changed the title Add ctrl-c e2e test for SIGINT propagation to running tasks test(e2e): add ctrl-c propagation test for SIGINT handling Mar 28, 2026
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from c1d1b85 to 97f8b7b Compare March 28, 2026 11:01
@branchseer branchseer force-pushed the add-argv-step-mode branch 2 times, most recently from 5781dac to ad91c93 Compare March 28, 2026 11:03
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch 2 times, most recently from 4ea2b22 to e84a708 Compare March 28, 2026 11:21
@branchseer branchseer force-pushed the add-argv-step-mode branch 2 times, most recently from 786331f to fbc75db Compare March 28, 2026 11:47
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from e84a708 to edfdcbc Compare March 28, 2026 11:47
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from edfdcbc to 8721599 Compare March 28, 2026 11:53
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from 8721599 to 9314b46 Compare March 28, 2026 13:24
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from 9314b46 to 69e5d13 Compare March 28, 2026 13:29
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from 69e5d13 to 13f2b7b Compare March 28, 2026 14:16
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from 13f2b7b to 685193b Compare March 28, 2026 14:53
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from 685193b to 07348e4 Compare March 28, 2026 14:55
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from 07348e4 to 522e8ec Compare March 28, 2026 15:17
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch 2 times, most recently from b6ef94b to 9ae39c0 Compare March 28, 2026 15:38
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from 9ae39c0 to c301f3c Compare March 28, 2026 15:45
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from c301f3c to ecf2fbc Compare March 28, 2026 16:14
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from ecf2fbc to 1b4b4ba Compare March 28, 2026 16:25
Base automatically changed from add-argv-step-mode to main March 28, 2026 16:41
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from 1b4b4ba to 7292492 Compare March 28, 2026 16:43
branchseer and others added 2 commits March 29, 2026 01:07
Add a `vtt exit-on-ctrlc` subcommand and e2e fixture that verifies SIGINT
propagates to concurrent tasks when the user presses Ctrl+C. The test runs
two packages with `vt run -r dev` (using argv spawn mode), synchronizes
via milestone protocol, then sends ctrl-c and verifies both tasks handle it.

Changes:
- `vtt exit-on-ctrlc`: sets up ctrl-c handler, emits "ready" milestone,
  prints "ctrl-c received" and exits on SIGINT. On Windows, clears the
  inherited CONSOLE_IGNORE_CTRL_C flag (set by an ancestor process via
  CREATE_NEW_PROCESS_GROUP) before registering the handler.
- `vt main.rs`: register no-op ctrlc handler before tokio runtime so vt
  survives Ctrl+C and reports actual task exit status. Use process::exit
  to avoid Windows runtime cleanup issues.
- `ctrl-c` WriteKey variant for e2e test interactions (rename_all kebab-case)
- Fix `expect_milestone` to preserve unmatched milestones in a local buffer
  instead of dropping them via `take_unhandled_osc_sequences`
- Strip `^C` terminal echo and normalize `ctrl-c received` count in e2e
  redaction for cross-platform consistency
- Fix incorrect comment in pty_terminal test about CTRL_C ignore flag source

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Revert pending_osc buffering in pty_terminal_test (unnecessary)
- Remove "ctrl-c receivedctrl-c received" redaction (no longer needed)
- Use single-package fixture with vite-task.json command instead of
  multi-package workspace with two concurrent tasks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@branchseer branchseer force-pushed the add-ctrl-c-e2e-test-v2 branch from 7292492 to dab5d8c Compare March 28, 2026 17:25
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