Repository navigation
test(host): serialize the pty-heavy terminal capacity tests - #1607
Merged
Merged
Conversation
The macOS host-core job failed once with
terminal::manager::tests::global_capacity_is_enforced_across_conversations
create session: Spawn("SPAWN_FAILED: openpty: ... code: 6")
ENXIO here is the machine-wide pty table, not an fd budget (which reports
EMFILE): macOS serves kern.tty.ptmx_max ptys (511; openpty starts failing at
the 505th) and cargo test runs test functions in parallel, so the four
capacity/retention tests overlapping asked the OS for ~95 ptys at once, three
or four application instances' worth, while a single FutureOS process can only
hold MAX_SESSIONS.
The tests keep their full demand, they just take turns, so the terminal
module's peak falls from 115 to 58 live ptys (four test threads).
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.
A test-infrastructure fix for the
future-hostterminal tests. The macOShost-corejob failed once interminal::manager::tests::global_capacity_is_enforced_across_conversationswithopenpty: … code: 6(ENXIO).ENXIOthere is the machine-wide PTY table, not an fd budget (an fd limit reportsEMFILE): macOS serveskern.tty.ptmx_maxptys (511, failing at the 505th), andcargo testruns test functions in parallel, so the four capacity/retention tests overlapping asked the OS for roughly 95 ptys at once while the whole suite was also holding sessions.The tests keep their full demand — every one still creates its quota and proves the refusal past it — and simply take turns on a
pty_heavy_guard()mutex for the duration of their body. Measured on an idle machine: the terminal module's peak falls from 115 to 58 live ptys, the wholefuture-hostcore suite from 116 to 63.Commits
Verification
Local, in a detached worktree at
a0b24949e, pinned toolchainrustc 1.99.1,ulimit -n 8192,CARGO_TARGET_DIR=<repo>/target:cargo fmt -p future-host -- --check→ cleancargo clippy -p future-host --all-targets -- -D warnings→ cleancargo test -p future-host --lib→ 2249 passed, 0 failed, 15 ignored (457.6 s)Notes
No assertion,
#[ignore], timeout or lint allowance was changed. The guard is taken as a named binding (let _heavy = …) so it lives for the whole test body, and it recovers from a poisoned lock so one panicking test cannot fail every later one.User-visible changes
none — test-only change under
host/src/terminal/.