Repository navigation
test(lorectl): open the test terminal close-on-exec - #415
Merged
Merged
Conversation
on_a_terminal's pty was inheritable, and openpt cannot set close-on-exec on macOS, so every child a parallel test spawned meanwhile got the terminal and stalled for seconds at exit. hooks_go_on_without_a_working_tree_that_does_not_answer failed whenever lorectl's test binaries ran together.
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.
What
on_a_terminal(crates/lorectl/tests/common/mod.rs, added with #397) sets close-on-exec on the pty master and opens the slave withO_CLOEXEC. The child still gets the terminal as stdin.Why
rustix::pty::openptcannot set close-on-exec on macOS and the slave was opened without it, so every child a parallel test spawned during amemcall inherited the terminal and stalled for seconds at exit.hooks_go_on_without_a_working_tree_that_does_not_answerfailed (session-start took ~6s) whenever lorectl's test binaries ran together; #414 fixed the other half (hooks waiting for stdin EOF).Test
cargo test -p lorectl --test hook --test mcp --test plugin --test memfailed 2/2 with #414 alone and passes 5/5 with this.cargo test -p lorectl --no-fail-fastpasses; clippy clean. Test-only change.