Add unit test locking in #6753 anti-flicker progress fix#8658
Merged
Evangelink merged 1 commit intoMay 28, 2026
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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_WhenProgressVersionUnchangedusing the existing gated-refresher pattern. - Uses
StopwatchFactoryto deterministically tick1s→2s(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
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.
Follow-up to #8348 (which fixed issue #6753 by removing the
&& falseleftover that bypassed the duration-only render optimization).Adds
AnsiTerminal_ProgressFrame_OnlyUpdatesDuration_WhenProgressVersionUnchangedto lock the behavior in:OnProgressStartUpdate/OnProgressStopUpdatehooks (same pattern as the existing BufferWidth test)1s->2s) and asserts the second render only rewrites the duration cell (noCSI K, no counters, no assembly name)Manually verified that the test fails if
&& falseis reintroduced on the optimization guard inAnsiTerminalTestProgressFrame.Render.