terminal: Stabilize persistence replay smoke tests by dmitrivMS · Pull Request #336677 · microsoft/vscode · GitHub
Skip to content

terminal: Stabilize persistence replay smoke tests - #336677

Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
mainfrom
agents/fix-ci-test-failure-pull-323980
Sep 18, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 2 commits into
mainfrom
agents/fix-ci-test-failure-pull-323980

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes microsoft/vscode-engineering#3893.

Summary

Stabilize the terminal persistence smoke tests introduced by #323980 by separating completed-output replay from subsequent live output:

  • Wait for the initial numbered output to finish before reloading the window or detaching the terminal.
  • Keep the producer alive in raw input mode during reconnect, then focus the restored terminal and send a continuation line to produce the final output without shell prompt or input-echo redraws.
  • Keep the strict assertion over the entire sequence, detecting missing, duplicated, or out-of-order entries without filtering them out.
  • Rename the tests to describe completed-output replay and remove the arbitrary detached delay.

Why

The Windows failure in Azure build 474799 captured [21, 0, 1, ..., 99]: live output arrived before the replayed buffer. Local validation with retries disabled also reproduced a missing entry when live output raced replay.

The macOS detach/attach trace also showed that replay was complete before a wrapped shell prompt redrew over entries 95–99. Keeping the producer alive avoids returning to that prompt; raw input additionally prevents Windows console input echo from overwriting replayed output.

This is a test-only change. It verifies replay and subsequent live delivery separately rather than relying on concurrent live/replay ordering; it does not change production behavior.

Validation

  • Smoke-test TypeScript compilation passed.
  • Targeted hygiene and ESLint passed.
  • Both Windows Insiders cases passed five consecutive runs with Mocha retries disabled: 10 passes.
  • Sequence checks confirmed that duplicate, missing, and out-of-order entries still fail the assertion.
  • macOS / Electron-Smoke passed on commit 49bef25: Code OSS CI.

Wait for the finite producer before reconnecting, then verify both ordered replay and fresh live output without racing the two.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 18, 2026 02:43
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added vscode-build VS Code build process issues engineering VS Code - Build / issue tracking / etc. labels Sep 18, 2026
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added this to the 1.139.0 milestone Sep 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The reviewed test-only changes have no unresolved blocking issues.

Review effort: Lite (auto)
Findings: None

Note

Copilot is running an experiment and ran this review at Lite.

What changed in this PR

Stabilizes terminal persistence replay smoke tests by separating completed replay from subsequent live output.

Changes:

  • Waits for producer completion before reconnecting.
  • Focuses the restored terminal and emits a final live line.
  • Validates the complete sequence strictly and removes the arbitrary delay.
File Description
test/​smoke/​src/​areas/​terminal/​terminal-persistence.test.ts Updates replay tests for deterministic reconnect and strict sequence validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Keep the producer alive in raw input mode and request the final output through stdin, preventing macOS prompt and Windows input-echo redraws from overwriting the replayed sequence.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) marked this pull request as ready for review September 18, 2026 04:28
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit e104ff0 into main Sep 18, 2026
53 of 54 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the agents/fix-ci-test-failure-pull-323980 branch September 18, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineering VS Code - Build / issue tracking / etc. vscode-build VS Code build process issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants