Skip to content

test(terminus): wait for the foreground job before interrupting it - #4956

Open
yaoyu-33 wants to merge 1 commit into
mainfrom
yuya/terminus-interrupt-test-startup-race
Open

yaoyu-33 wants to merge 1 commit into
mainfrom
yuya/terminus-interrupt-test-startup-race

Conversation

@yaoyu-33

@yaoyu-33 yaoyu-33 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What changed and why

Wait until tmux reports sleep as the foreground command before pasting queued input and triggering shell exit in test_exited_shell_recovery_discards_pending_input_and_reports_lost_state.

A slow login shell can leave the command unread when Ctrl-C arrives. The pending-input drain then consumes the command itself, so the test never starts the foreground job it intends to interrupt. Waiting for the foreground command makes that setup deterministic without weakening the discarded-input, preserved-file, or lost-shell-state assertions.

This complements #4966, now on main, which clears PROMPT_COMMAND so Ubuntu 26.04's login hook does not prevent the shell from exiting on Ctrl-C. The previous description attributed the Ubuntu CI failures solely to startup timing; #4966 identified this additional cause.

Rebased onto main at 8041d1910, including #4973's atomic resubmit-lock fix. The prior red Unit tests / Test job failed in test_two_concurrent_resubmits_queue_one_job, outside the Terminus change.

Issue: none needed for this focused test reliability fix.

Validation

On the rebased head:

  • pytest responses_api_agents/terminus_2_sandboxed_agent/tests/test_terminal.py: 18 passed, 4 skipped on macOS. The four skips require Linux tmux; they need fresh Linux CI.
  • pytest tests/unit_tests/test_eval_resubmit.py: 39 passed.
  • pre-commit run --all-files, git diff --check, and DCO trailer checks: passed.

Earlier validation recorded on the original PR head used a throwaway macOS adaptation with Bash 5.2.37 and delayed login startup. It reported 180/180 runs across both exit variants and 0 s, 0.8 s, and 1.5 s startup delays. Those adapted runs were not repeated during this rebase.

Rollout evidence

N/A: test-only change; no agent, verifier, or runtime behavior changes.

@copy-pr-bot

copy-pr-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@yaoyu-33

Copy link
Copy Markdown
Contributor Author

/ok to test bf873a4

@nemo-automation-bot
nemo-automation-bot Bot requested a review from a team October 23, 2026 02:08
@svcnvidia-nemo-ci svcnvidia-nemo-ci added area:agent Agent harnesses and Responses API agent behavior bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer labels Oct 23, 2026
The exited-shell interrupt test typed `...; set -e; sleep 120` about 0.5 s
after Harbor starts `bash --login`, then pasted queued input and sent
Ctrl-C. On the ubuntu-26.04 runner image the login shell can still be
starting at that point. The pre-Ctrl-C input drain then consumes the
unread command line itself, `sleep` never runs, Ctrl-C reaches an idle
prompt, and the shell never exits (`pane_dead` stays 0).

Wait until tmux reports `sleep` as the pane's foreground command before
pasting the queued input, so both variants exercise the state they
assert on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: yaoyu-33 <[email protected]>
@yaoyu-33
yaoyu-33 force-pushed the yuya/terminus-interrupt-test-startup-race branch from bf873a4 to 5f8b084 Compare October 23, 2026 20:50
@github-actions github-actions Bot added the sla:triage-overdue Review assignment is over the one-business-day SLA label Oct 26, 2026

This branch was previously deployed

1 inactive (outdated) deployment
public — bf873a4f Deployed Oct 23, 2026 by copy-pr-bot[bot] via release / finalize / notify #6740
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent Agent harnesses and Responses API agent behavior bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer sla:triage-overdue Review assignment is over the one-business-day SLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants