Conversation
…wn; ensure teardown does not wait for unrelated descendants
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #827 +/- ##
==========================================
- Coverage 79.86% 79.85% -0.01%
==========================================
Files 151 152 +1
Lines 21872 22144 +272
Branches 14197 14338 +141
==========================================
+ Hits 17467 17683 +216
- Misses 2601 2648 +47
- Partials 1804 1813 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Background descendants can keep the PTY open after the shell is gone. Drain the last output and report the real status on that path, including the NetBSD reap, and cover it with tests that do not treat local echo as ready. Co-authored-by: Cursor <cursoragent@cursor.com>
Darwin EOFs the PTY master when the forkpty session leader exits even if a descendant still holds the slave, so the unit test no longer requires a non-EOF probe there. The e2e ready check strips shell-integration OSC/CSI noise that was glued onto the marker line on Fedora. Prefer clang-format 18 locally so Formatting Check stays green. Co-authored-by: Cursor <cursoragent@cursor.com>
Detach the grandchild with setsid/O_NOCTTY so Darwin CI does not reclaim it with the forkpty session, and stop probing the master for EOF — BSD EOFs the master when the session leader exits even while a descendant holds the slave. Co-authored-by: Cursor <cursoragent@cursor.com>
macOS msan/novcpkg still tore down the grandchild when the forkpty child exited mid-setup. Have the holder signal readiness only after setsid and reopening the slave so the session leader cannot exit early. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
TERMINAL_EXIT_STATUSwith the real OpenSSH-style code. NetBSD's reapingwaitpidstores that status beforehandleSessionEnd()returns.inlineSSH-config helpers.Closes #448.
Test plan
./et-test "[BackgroundProcessTeardown]"— childReaped, exit status 42 aftersessionHasEnded(), NetBSD status helper, and a grandchild that is still alive after the session leader exits (exit status 42; no master-EOF probe, which is not portable on Darwin/FreeBSD)./et-test "sessionHasEnded path sends TERMINAL_EXIT_STATUS"— buffered output plus exit code 37python3 test/system_tests/et_background_process_e2e.py --et build/et --etserver build/etserver --etterminal build/etterminal— remote ready line is exact (not local echo or shell-integration OSC);etexits 0 while a background sleep is still alive98cfd84cc(37 checks, mergeable)