Skip to content

Add unit test locking in #6753 anti-flicker progress fix#8658

Merged
Evangelink merged 1 commit into
microsoft:mainfrom
Evangelink:dev/amauryleve/6753-duration-only-update-test
May 28, 2026
Merged

Add unit test locking in #6753 anti-flicker progress fix#8658
Evangelink merged 1 commit into
microsoft:mainfrom
Evangelink:dev/amauryleve/6753-duration-only-update-test

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Follow-up to #8348 (which fixed issue #6753 by removing the && false leftover that bypassed the duration-only render optimization).

Adds AnsiTerminal_ProgressFrame_OnlyUpdatesDuration_WhenProgressVersionUnchanged to lock the behavior in:

  • gates the progress refresher with the existing OnProgressStartUpdate / OnProgressStopUpdate hooks (same pattern as the existing BufferWidth test)
  • ticks the stopwatch twice with same-length durations (1s -> 2s) and asserts the second render only rewrites the duration cell (no CSI K, no counters, no assembly name)

Manually verified that the test fails if && false is reintroduced on the optimization guard in AnsiTerminalTestProgressFrame.Render.

Adds AnsiTerminal_ProgressFrame_OnlyUpdatesDuration_WhenProgressVersionUnchanged

which guards the duration-only render path that PR microsoft#8348 restored after the

`&& false` leftover was removed.

The test gates the progress refresher with the existing OnProgressStartUpdate/

OnProgressStopUpdate hooks, ticks the stopwatch twice with same-length durations

(1s -> 2s), and asserts that the second render only rewrites the duration cell

(no CSI K, no counters, no assembly name).

Verified the test fails if `&& false` is reintroduced on the optimization guard.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 28, 2026 12:38

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.

Pull request overview

Adds a regression unit test that locks in the anti-flicker progress optimization fixed in PR #8348 (issue #6753), ensuring the ANSI progress frame only rewrites the duration cell when the progress state's Id+Version are unchanged between refresh ticks.

Changes:

  • New test AnsiTerminal_ProgressFrame_OnlyUpdatesDuration_WhenProgressVersionUnchanged using the existing gated-refresher pattern.
  • Uses StopwatchFactory to deterministically tick 1s2s (same length) so the duration-only branch is taken.
  • Asserts the second render contains only the duration update (no CSI K, no counters/assembly name).
Show a summary per file
File Description
test/UnitTests/Microsoft.Testing.Platform.UnitTests/OutputDevice/Terminal/TerminalTestReporterTests.cs Adds regression test gating the refresher thread and verifying duration-only re-render path

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

@Evangelink Evangelink merged commit ac24cdf into microsoft:main May 28, 2026
25 checks passed
@Evangelink Evangelink deleted the dev/amauryleve/6753-duration-only-update-test branch May 28, 2026 13:32
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.

2 participants