fix(terminal): skip PTY tests when no PTY can be allocated (VA-64) #68
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VA-64-pty-tests-skip-without-pty"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the racy
host::terminalPTY unit-test failures in CI (oci-build/check.DockerfileRUN cargo test). See VA-64.Problem
echo_through_cat_round_trips,close_kills_child_and_pushes_terminal_exit, andresize_does_not_error_on_live_sessionopen a real PTY viaportable-ptyopenpty. Adocker buildRUN sandbox does not reliably mount/dev/pts(unlikedocker run/docker compose run), soopenptyintermittently fails withPty("No such file or directory"). The failure is racy - in one CI run the echo test passed while the other two panicked on.expect("spawn"), failing the whole build check and blocking unrelated PRs.Fix
Add a
pty_available()probe to the test module; the three PTY tests skip (earlyreturn, no assertion) whenopenptycannot allocate, instead of failing. They still run and assert wherever a PTY is available (dev hosts,docker run).open_with_missing_program_returns_pty_erroris unaffected (it expects aPtyerror either way). Test-only change; no production code touched.Verification
check.Dockerfile(fmt + clippy--deny warnings+ build +cargo test --workspace --lib) passes. On a host with a PTY the three tests execute and pass; in the no-devpts sandbox they skip.The terminal tests that open a real PTY (echo_through_cat_round_trips, close_kills_child_and_pushes_terminal_exit, resize_does_not_error_on_live_session) panic with Pty("No such file or directory") in the check.Dockerfile build sandbox, which does not reliably mount /dev/pts (unlike docker run / compose run). The failure is racy: in one CI run the echo test passed while the other two failed, failing the whole check. Add a pty_available() probe to the test module and skip (return early, no assertion) when openpty fails, instead of failing the build. The tests still run and assert wherever a PTY is available. open_with_missing_program_returns_pty_error is unaffected: it expects a Pty error and gets one whether openpty or exec fails. #VA-64