Repository navigation
Conversation
This was referenced Oct 22, 2026
…hang When a test that drives the CLI failed before it reaped the process, for example at a prompt that never appeared, the process kept running. So did the blocking task that read its terminal or waited for it, and the test runtime waits for such tasks at shutdown, so the whole run hung. Each of these tests now holds a KillOnDrop guard from spawn, and waits through exit_within, which kills the process on a timeout and disarms the guard once the process is reaped. A terminal step may now take 30 seconds instead of 10, because a device login waits out a 5-second poll interval before its first prompt.
tee8z
force-pushed
the
test/terminal-harness-cleanup
branch
from
October 26, 2026 23:06
c4e9c64 to
5278048
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A test that drives the CLI and fails before it reaps the process leaves the process running. For example, a terminal test can time out waiting for a prompt. The blocking task that reads the process's terminal, or waits for its exit, then never returns. The Tokio test runtime waits for blocking tasks when it shuts down, so one failure hangs the whole
cargo testrun, instead of failing it.This happened during reviews. On the head of #94, the integration suite stopped for 28 minutes in
login_on_a_terminal_reports_why_no_profile_was_saved_and_still_succeeds, with avoltage loginprocess still waiting at its prompt. In the same reviews, the #75 terminal tests also failed 5 times at their 10-second limits, while instrumented builds ran in parallel. Each passed when rerun.Change
KillOnDropkills the process as the test unwinds, and the test failstimeout(...).unwrap()panics, and the blocking wait remains, or each test kills the process itselfexit_withinfails with a message, and the guard kills the processon_a_terminal_with)TERMINAL_STEP)KillOnDropis created right after each spawn.exit_withindisarms it once the process is reaped, because a reaped process ID can be reused.spawn_blockingnow usesexit_within: the terminal and hidden-prompt harnesses, the Ctrl-C tests, the checkout stream, progress, and early-closing-pipe tests,fully_on_a_terminal_ending, and the fourpayments list --watchtests from feat(cli): follow payments live with payments list --watch #111. The three hand-writtenkill -KILLblocks are removed. A--watchprocess runs until Ctrl-C, so a watch test that failed before its interrupt would hang the run without the guard.Only
tests/cli_integration.rschanges, and no behavior of the CLI changes.Checks
master, the run was still going after 60 seconds, and an outer 120-second timeout killed it (exit 124). On this branch, the test fails after 30.01 seconds with exit 101, and no CLI process is left. That change is not committed.nix develop:cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings,cargo machete --with-metadata,cargo test --locked(197 unit, 149 integration) andpython3 scripts/check-coverage.pypass.wait_for_paymentat 18.10, which is unchanged.master, I changed one watch test's assertion so it failed before its Ctrl-C. The test failed in 1.1 seconds and left no CLI process. That change is not committed.voltage-pr-review.Limits
master. The 30-second limit is a margin based on the failures I saw, and it is not proven to fix them.openptyand theFD_CLOEXECcalls. This PR does not change that.