Repository navigation
test(pty): wait for the line editor instead of a fixed 600 ms (closes #58) - #61
Merged
Merged
Conversation
ShortArrow
force-pushed
the
test/pty-wait-for-editor
branch
from
October 11, 2026 23:43
7a9d4fc to
5224be7
Compare
…58) pwsh's PSReadLine could start after the window ended, so the first bootstrap line was rendered but never run; under CPU load the old wait failed 30 of 30 runs and this one 0 of 30.
ShortArrow
force-pushed
the
test/pty-wait-for-editor
branch
from
October 11, 2026 23:43
5224be7 to
c62e140
Compare
ShortArrow
marked this pull request as ready for review
October 11, 2026 23:45
This was referenced Oct 12, 2026
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.
Closes #58.
Why the bootstrap waits for a signal instead of a fixed time
PtySession::spawnused to drain the shell's output for a fixed 600 ms before sending the first bootstrap line. pwsh's PSReadLine starts reading keys only after it has sent its cursor-position query, about 300 ms after launch on an idle machine. On a slow macOS runner it started after the 600 ms had passed, so the first line was rendered but never run, and the step timed out after 5 s. With the failure output from #60, the CI failure showed exactly that: the whole line drawn, then no newline.The harness now waits until each shell's line editor reads keys. pwsh sends two cursor-position queries, nu's reedline sends one, and bash and zsh send none and print a prompt. Each editor blocks until its query is answered, so the queries arrive one at a time and can be counted. After the signal the shell must print nothing for 100 ms. A shell that is not ready within 5 s fails at the
startupstep.How it was checked
With 96 busy processes on a 32-core WSL machine, the pwsh PTY tests failed 30 of 30 runs with the fixed wait, every time at the same step as on macOS CI, and 0 of 30 runs with this change. Under the same load the bash, zsh, nu and pwsh tests each passed 10 of 10 runs.