Skip to content

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

Merged
wan9chi merged 2 commits into
mainfrom
add-ctrl-c-e2e-test-v2
Mar 29, 2026
Merged

test(e2e): add ctrl-c propagation test for SIGINT handling#303
wan9chi merged 2 commits into
mainfrom
add-ctrl-c-e2e-test-v2

Conversation

@wan9chi

@wan9chi wan9chi commented Mar 28, 2026

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

wan9chi commented Mar 28, 2026

Copy link
Copy Markdown
Member Author

@wan9chi wan9chi 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
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from c1d1b85 to 97f8b7b Compare March 28, 2026 11:01
@wan9chi wan9chi force-pushed the add-argv-step-mode branch 2 times, most recently from 5781dac to ad91c93 Compare March 28, 2026 11:03
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch 2 times, most recently from 4ea2b22 to e84a708 Compare March 28, 2026 11:21
@wan9chi wan9chi force-pushed the add-argv-step-mode branch 2 times, most recently from 786331f to fbc75db Compare March 28, 2026 11:47
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from e84a708 to edfdcbc Compare March 28, 2026 11:47
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from fbc75db to 8e34039 Compare March 28, 2026 11:53
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from edfdcbc to 8721599 Compare March 28, 2026 11:53
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from 8e34039 to cae622a Compare March 28, 2026 13:24
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from 8721599 to 9314b46 Compare March 28, 2026 13:24
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from cae622a to d1996eb Compare March 28, 2026 13:29
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from 9314b46 to 69e5d13 Compare March 28, 2026 13:29
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from d1996eb to a3716a4 Compare March 28, 2026 14:16
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from 69e5d13 to 13f2b7b Compare March 28, 2026 14:16
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from a3716a4 to a2efffe Compare March 28, 2026 14:53
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from 13f2b7b to 685193b Compare March 28, 2026 14:53
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from a2efffe to c7a069c Compare March 28, 2026 14:55
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from 685193b to 07348e4 Compare March 28, 2026 14:55
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from c7a069c to 91845ad Compare March 28, 2026 15:17
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from 07348e4 to 522e8ec Compare March 28, 2026 15:17
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from 91845ad to 07283e0 Compare March 28, 2026 15:26
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch 2 times, most recently from b6ef94b to 9ae39c0 Compare March 28, 2026 15:38
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from 07283e0 to c4118ad Compare March 28, 2026 15:38
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from c4118ad to e185c1a Compare March 28, 2026 15:45
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from 9ae39c0 to c301f3c Compare March 28, 2026 15:45
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from e185c1a to ef2c4b4 Compare March 28, 2026 16:14
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from c301f3c to ecf2fbc Compare March 28, 2026 16:14
@wan9chi wan9chi force-pushed the add-argv-step-mode branch from ef2c4b4 to 80980a2 Compare March 28, 2026 16:25
@wan9chi wan9chi 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
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from 1b4b4ba to 7292492 Compare March 28, 2026 16:43
wan9chi 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>
@wan9chi wan9chi force-pushed the add-ctrl-c-e2e-test-v2 branch from 7292492 to dab5d8c Compare March 28, 2026 17:25
@wan9chi wan9chi marked this pull request as ready for review March 29, 2026 04:39
@wan9chi wan9chi merged commit 8da83e9 into main Mar 29, 2026
10 checks passed
@wan9chi wan9chi deleted the add-ctrl-c-e2e-test-v2 branch March 29, 2026 04:40
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