Repository navigation
fix: session-e2e bounds its host-side ssh waits on a host that has no GNU timeout, such as a stock - #3374
Conversation
A stock Mac has no timeout on PATH, so the four host-side ssh waits in session-e2e.sh failed with 'timeout: command not found'. e2e_timeout uses timeout, else gtimeout, else a background watcher that ends the command with 124.
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
|
Approved: every review thread resolved at @norrietaylor resolved the last thread, which releases the approval this review had withheld. Nothing to do. |
The fallback watcher sent TERM to a command that had exited but was not yet reaped. kill succeeds on a zombie, so a real exit code became 124. The watcher now checks the state with ps first and treats a zombie as done. Without ps, the kill decides as before. The harness links ps only when the host has it.
|
Round 1 of 10 on the runtime's review findings, pushed as
Verify Converted to a draft: something above needs a person before review. Review threads the coder judged:
On a Mac with no coreutils in PATH, scripts/session-e2e.sh bounds its host-side ssh waits with e2e_timeout. The exec-by-id group can pass and the later groups run, with no 'timeout: command not found' message. A command that ends just before the limit now keeps its own exit code and does not become 124. Notes from the agent: Revise round 1. The watcher in e2e_timeout now runs 'ps -o stat= -p' before its kill and treats a zombie (state Z) as a command that ended in time. If ps is missing, the check finds nothing and the kill decides, as before. This box has no ps, so the harness now links ps into its reduced PATH only when the host has it. A command that ends between the check and the kill still reports 124. That is a command that ends at the limit, and GNU timeout gives 124 in that case too. Both test lines fail only in scripts/metrics_test.sh (missing_nextest_fails_mutants_mode, exit 127, no snapshot.json). That harness does not source or call either changed file, so I think the failure comes from this box and not from this change. I did not run the e2e on a Mac, so this box cannot confirm the proof end to end. |
|
Round 2 of 10 on a failed check suite: the coder changed nothing. every commit this round put on the branch above fcbfa15 is a merge of the base branch, so it carries no work of its own |
There was a problem hiding this comment.
Reviewed against D3153 at fcbfa15a. scripts/e2e-host-timeout.sh uses GNU timeout or gtimeout when present. Without them, a watcher subshell sends TERM at the limit, and the result is 124. It keeps the caller's stdin and reports the command's own exit code otherwise. The LOW zombie thread is fixed: the watcher checks ps and exits 0 for a command that already ended. session-e2e.sh uses it for the host-side waits only; the in-box timeout calls are unchanged. The _test.sh harness removes timeout/gtimeout from PATH, so it exercises the fallback. Arch: PASS (design silent). Residual: #3153's stock-Mac proof has not run yet, since the CI macOS runner has GNU timeout.
There was a problem hiding this comment.
minimal-review — approved
Verdict APPROVE — every review thread is resolved; @norrietaylor closed the last one. The review of fcbfa15ab7b1 withheld this approval on the threads open then. Posted as a comment: the App cannot approve its own pull request; the check and the label carry it.
Defect
Fixes #3349
scripts/e2e-host-timeout.shscripts/session-e2e.shscripts/e2e-host-timeout_test.shTask marker
Proof
scripts/session-e2e.sh now sources scripts/e2e-host-timeout.sh and uses e2e_timeout for the four host-side ssh waits in the exec-reattach and box-exec groups. With no timeout and no gtimeout on PATH, as on a stock Mac, e2e_timeout runs the command in the background. It keeps the caller's stdin, passes the exit code through, and ends the command with exit 124 after the limit. So a 'timeout: command not found' message does not stop those groups, and the groups after them run. The new harness proves this on a reduced PATH. This box did not run the Mac e2e itself.
Notes from the agent: The pre-existing failure in scripts/metrics_test.sh (missing_nextest_fails_mutants_mode, exit 127 and no snapshot.json) occurs with this box's toolchain at the base commit too. It is outside this task. The source lines use '# shellcheck disable=SC1091' because just test-shell runs shellcheck without -x. scripts/lint-shell.sh passes. The fallback sends SIGTERM only, the same as the GNU timeout default. The other timeout calls in session-e2e.sh run inside the box (through sh -c), so they are unchanged. I did not run the Mac e2e (just e2e). The proof on a real Mac is still for the ci-macos lane to show.
Tests
cargo test -p common --test shell_harnessesjust test-shellVerify
min task run agent-verifypassed ([tasks.verify]).