Repository navigation
test(terminal): page through scrollback only after the command's output has printed - #831
Merged
Merged
Conversation
…ut has printed The wait matched "300", which is already on screen as the typed command line echoes, so Shift+PageUp could arrive before any scrollback existed and the view stayed at the bottom. Wait for a marker only the command's output prints, and keep sleep in the foreground so no prompt follows it.
sambitcreate
enabled auto-merge
November 18, 2026 03:19
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes I reviewed the terminal scrollback E2E synchronization fix in 89b1bf0c9.
- Output-only synchronization — The test now waits for
lines-done, which cannot be matched by the literal echoed command, before sending scrollback shortcuts. - Stable terminal state — The foreground
sleepprevents a subsequent prompt from changing the viewport during assertions and matches the established adjacent terminal-selection test pattern. - Verification —
npm run type-check:e2epasses, and the change does not alter production code or external contracts.
@v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏
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.

Fixes the flaky E2E `tests/e2e/workspace-panel.spec.ts:409` ("scrollback keys move through history without reaching the shell"), which failed with `--fail-on-flaky-tests` on unrelated PRs (for example #802, job 134369661796).
Cause
The test waited for `/\b300\b/` before pressing Shift+PageUp. The typed command line `seq 1 300` is echoed as it is typed, so the wait could pass before `seq` had printed anything. Shift+PageUp then arrived while there was no scrollback to page through, the 300 lines landed afterwards, and the view stayed at the bottom (the failure shows `292…300` and the prompt). It is the same race #774 fixed in the selection-action test.
Fix
The test now runs `M=lines; seq 1 300; echo "$M-done"; sleep 60` and waits for `lines-done`, a line only the command's output prints. The `sleep` stops the prompt from printing after it. There are no added retries or timeouts, and the app's code is unchanged.
Verification (Cua Space, `--repeat-each=20 --retries=0`)