Skip to content

test(debug): let the program say when to print, not a timer - #101

Merged
BartvHelvert merged 1 commit into
masterfrom
test/terminal-first-word
Nov 6, 2026
Merged

BartvHelvert merged 1 commit into
masterfrom
test/terminal-first-word

Conversation

@BartvHelvert

Copy link
Copy Markdown
Owner

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's cmd took over a second more to start on its pseudo-terminal, so the output arrived after the 2 s grace that finished() allows a terminal that hasn't printed yet.

The program now creates a started file once it runs, stays silent until the test creates speak, then prints and lingers. The test waits for started (up to 20 s), checks that finished() 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, because cmd /c has no simple way to poll a file. Production code is unchanged.

Fixes #100

How it was tested

Checklist

  • Nothing is special-cased for one extension.
  • A new feature has a UI test. Test-only change.
  • No internal, override-only, obsolete or deprecated platform API.
  • docs/ is updated where behaviour changed, docs/status.md especially. No behaviour change.
  • Third-party material keeps its notice and is listed in NOTICE.md. None added.

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
@BartvHelvert
BartvHelvert merged commit 2c5bd24 into master Nov 6, 2026
6 of 8 checks passed
@BartvHelvert
BartvHelvert deleted the test/terminal-first-word branch November 6, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky Windows test: terminal slow to print its first word

1 participant