Repository navigation
test(debug): let the program say when to print, not a timer - #101
Merged
Merged
Conversation
The test for a terminal that is slow to print its first output started a program that slept 1 s before printing and asked for the session's end at once. With no output yet, the end gives up after a 2 s grace, so on a slow Windows runner, where cmd took over a second to start on its pseudo-terminal, the text came too late and the test failed. The program now writes a file once it is running, stays silent until the test creates another, then prints and lingers. The test checks that the end is still waiting after twice the quiet period, then lets the program speak, so the silence it measures is its own, not the runner's startup. Refs #100
4 tasks
This was referenced Nov 6, 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.
What this changes
Makes
RunInTerminalTest's "a terminal that is slow to say its first word is not taken as quiet" test deterministic. It failed on PR #92's Windows run: the program slept 1 s before printing, and the runner'scmdtook over a second more to start on its pseudo-terminal, so the output arrived after the 2 s grace thatfinished()allows a terminal that hasn't printed yet.The program now creates a
startedfile once it runs, stays silent until the test createsspeak, then prints and lingers. The test waits forstarted(up to 20 s), checks thatfinished()is still waiting after 600 ms (twice the 300 ms quiet period), then lets the program speak and expects its text before the session ends. On Windows the program is PowerShell, becausecmd /chas no simple way to poll a file. Production code is unchanged.Fixes #100
How it was tested
:backend:test --tests RunInTerminalTeston Windows: all 7 pass.Checklist
A new feature has a UI test.Test-only change.No behaviour change.docs/is updated where behaviour changed,docs/status.mdespecially.Third-party material keeps its notice and is listed inNone added.NOTICE.md.