Skip to content

Commit 0a1cd19

Browse files
max-sixtyclaude
andauthored
chore: drop the NEXTEST_NO_INPUT_HANDLER workaround (#3482)
nextest#2878 (the run suspending with SIGTTOU when a test spawns an interactive shell, as the `shell-integration-tests` feature does) was fixed in nextest 0.9.118, so the `NEXTEST_NO_INPUT_HANDLER=1` workaround threaded through the insta hook, CI, and the test docs is obsolete. Verified on nextest 0.9.132: the shell-wrapper tests run to completion under a real PTY without the variable. `.config/nextest.toml` now pins `nextest-version = "0.9.118"`, so an older nextest fails with a clear version error instead of suspending mid-run. > _This was written by Claude Code on behalf of max_ --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 612580b commit 0a1cd19

7 files changed

Lines changed: 6 additions & 30 deletions

File tree

.config/nextest.toml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
# IMPORTANT: Tests that spawn interactive shells (zsh -ic, bash -ic) cause
2-
# nextest's InputHandler to receive SIGTTOU when restoring terminal settings,
3-
# suspending the test process. See https://github.com/nextest-rs/nextest/issues/2878
4-
#
5-
# Solution: Run with NEXTEST_NO_INPUT_HANDLER=1 or use the pre-merge hook which
6-
# sets this automatically:
7-
#
8-
# NEXTEST_NO_INPUT_HANDLER=1 cargo nextest run --features shell-integration-tests
9-
#
10-
# Or use `cargo test` which doesn't have this issue:
11-
#
12-
# cargo test --test integration --features shell-integration-tests
1+
# Older nextest suspends (SIGTTOU) when a test spawns an interactive shell
2+
# (zsh -ic, bash -ic), as the shell-integration-tests feature does; fixed in
3+
# 0.9.118 (https://github.com/nextest-rs/nextest/issues/2878).
4+
nextest-version = "0.9.118"
135

146
# Enable setup-scripts (still experimental in nextest) so the build-bins script
157
# below can run before any test starts.

.config/wt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ sync = 'if [ "{{ target }}" = "main" ]; then git pull && git push; fi'
2222
# `cargo update --locked` would also fail on dependencies merely behind latest.
2323
lockfile = "cargo update --workspace --locked"
2424
pre-commit = "pre-commit run --all-files"
25-
insta = """RUSTFLAGS='-D warnings' NEXTEST_NO_INPUT_HANDLER=1 cargo insta test --test-runner nextest --dnd --check $([ "$(uname)" = 'Linux' ] && echo '--unreferenced reject') --features shell-integration-tests"""
25+
insta = """RUSTFLAGS='-D warnings' cargo insta test --test-runner nextest --dnd --check $([ "$(uname)" = 'Linux' ] && echo '--unreferenced reject') --features shell-integration-tests"""
2626
doctest = "RUSTDOCFLAGS='-Dwarnings' cargo test --doc"
2727
doc = "RUSTDOCFLAGS='-Dwarnings' cargo doc --no-deps --document-private-items"
2828

.github/workflows/ci.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,6 @@ jobs:
363363
cargo-affected-db-v1-${{ runner.os }}-
364364
365365
- name: 📊 Collect coverage data
366-
env:
367-
NEXTEST_NO_INPUT_HANDLER: 1
368366
run: cargo affected collect -- --features shell-integration-tests
369367

370368
- name: 💾 Save coverage DB
@@ -457,7 +455,6 @@ jobs:
457455

458456
- name: 🎯 Run affected tests
459457
env:
460-
NEXTEST_NO_INPUT_HANDLER: 1
461458
# An empty affected selection is a valid outcome — a diff can touch
462459
# nothing with recorded coverage. nextest's default exits 4 ("no
463460
# tests to run"), which fails this advisory job spuriously. Windows
@@ -512,8 +509,6 @@ jobs:
512509
- run: cargo llvm-cov clean --workspace
513510

514511
- name: 📊 Generate coverage report
515-
env:
516-
NEXTEST_NO_INPUT_HANDLER: 1
517512
run: cargo llvm-cov --features shell-integration-tests --cobertura --output-path=cobertura.xml
518513

519514
- name: Upload code coverage results

.github/workflows/nightly.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,6 @@ jobs:
254254
run: rustup target add ${{ matrix.target }}
255255

256256
- name: 🧪 Tests
257-
env:
258-
NEXTEST_NO_INPUT_HANDLER: 1
259257
run: cargo nextest run --target ${{ matrix.target }}
260258

261259
check-unused-dependencies:

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ cli = [
100100
syntax-highlighting = ["dep:tree-sitter", "dep:tree-sitter-bash", "dep:tree-sitter-highlight"]
101101
# Enable shell/PTY integration tests (requires bash, zsh, fish installed on system)
102102
# Includes: shell wrapper tests, PTY-based approval prompts, TUI select, progressive rendering
103-
# These tests can cause nextest to suspend due to terminal foreground pgrp issues.
104-
# When enabled, run with NEXTEST_NO_INPUT_HANDLER=1 to avoid suspension.
105-
# See CLAUDE.md "Nextest Terminal Suspension" section for details.
106103
shell-integration-tests = []
107104
# Enable benchmarks whose fixture is too large for hosted CI: the rust-scale
108105
# prune fixture (~15 GiB of rust-lang/rust worktrees, cached in

tests/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A target-filtered run (`--lib`, `--test integration`, …) on a fresh `target/`
1414

1515
**Claude Code web:** `task setup-web` installs zsh/fish/nushell, `gh`, and dev tools. Install `task` first if needed: `sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/bin` then `export PATH="$HOME/bin:$PATH"`. The permission tests (`test_permission_error_prevents_save`, `test_approval_prompt_permission_error`) skip automatically when running as root.
1616

17-
**Shell/PTY tests** (`shell-integration-tests` feature: approval prompts, picker, progressive rendering, shell wrappers): tests that spawn interactive shells (`zsh -ic`, `bash -ic`) make nextest's InputHandler take SIGTTOU when restoring terminal settings, suspending the run mid-test (`zsh: suspended (tty output)`; see [nextest#2878](https://github.com/nextest-rs/nextest/issues/2878)). Use `cargo test` instead of `cargo nextest run`, or set `NEXTEST_NO_INPUT_HANDLER=1`. The pre-merge hook sets it automatically.
17+
**Shell/PTY tests** (`shell-integration-tests` feature): approval prompts, picker, progressive rendering, shell wrappers.
1818

1919
## Coverage Investigation
2020

tests/common/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,6 @@ pub fn merge_scenario_multi_commit(mut repo: TestRepo) -> (TestRepo, PathBuf) {
380380
///
381381
/// Use this instead of `portable_pty::native_pty_system()` directly to ensure
382382
/// PTY tests work correctly across platforms.
383-
///
384-
/// NOTE: PTY tests are behind the `shell-integration-tests` feature because they can
385-
/// trigger a nextest bug where its InputHandler cleanup receives SIGTTOU. This happens
386-
/// when tests spawn interactive shells (zsh -ic, bash -ic) which take control of the
387-
/// foreground process group. See https://github.com/nextest-rs/nextest/issues/2878
388-
/// Workaround: run with NEXTEST_NO_INPUT_HANDLER=1. See CLAUDE.md for details.
389383
pub fn native_pty_system() -> Box<dyn portable_pty::PtySystem> {
390384
#[cfg(unix)]
391385
ignore_tty_signals();

0 commit comments

Comments
 (0)