Skip to content

Test clipboard contention and delayed rendering - #15384

Merged
Shyam-Gupta merged 3 commits into
mainfrom
dev/shgu/clipboard-contention-coverage
Nov 9, 2026
Merged

Shyam-Gupta merged 3 commits into
mainfrom
dev/shgu/clipboard-contention-coverage

Conversation

@Shyam-Gupta

@Shyam-Gupta Shyam-Gupta commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Related to #15319 and #15346.

Proposed changes

  • Add real cross-process clipboard lock exhaustion and recovery tests, including the original failure HRESULT.
  • Exercise delayed Unicode rendering during replacement, checking clipboard ownership and preservation of posted messages.
  • Extend negative retry argument tests to both copy modes and int.MinValue.

Customer Impact

  • Protects clipboard replacement and delayed reading from contention regressions.
  • Verifies expected exceptions, recovery, and queued-message preservation.

Regression?

  • No; adds coverage for existing behavior.

Risk

  • Low. Test-only changes using the existing sequential collection, STA attributes, and RemoteExecutor
Microsoft Reviewers: Open in CodeFlow

Cover native clipboard lock exhaustion, recovery, delayed reads during replacement, and retry argument boundaries.

Co-authored-by: Copilot App <[email protected]>
@codecov

codecov Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.79260%. Comparing base (295f067) to head (8892897).

Additional details and impacted files
@@              Coverage Diff              @@
##                main      #15384   +/-   ##
=============================================
  Coverage   39.79260%   39.79260%           
=============================================
  Files            246         246           
  Lines           9836        9836           
  Branches        1036        1036           
=============================================
  Hits            3914        3914           
  Misses          5741        5741           
  Partials         181         181           
Flag Coverage Δ
Debug 39.79260% <ø> (ø)
production 42.31695% <ø> (ø)
test 19.92786% <ø> (ø)
unit 42.31695% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

🟡 Changes recommended

The clipboard contention tests lack bounded scenario retries, allowing transient locks from unrelated processes to cause spurious failures even with sequential execution.

1 open issue
What changed in this PR

Adds real cross-process clipboard regression coverage, complementing the synchronization and delayed-rendering work in #15319 and #15346. No production code changes.

Changes:

  • Test clipboard lock exhaustion, failure HRESULT preservation, and recovery.
  • Exercise delayed Unicode rendering during replacement, checking ownership and posted-message preservation.
  • Expand negative retry argument tests to both copy modes and int.MinValue.
File Description
src/​test/​unit/​System.Windows.Forms/​System/​Windows/​Forms/​ClipboardTests.cs Expands invalid retry argument coverage and adds explanatory comments.
src/​test/​unit/​System.Windows.Forms/​System/​Windows/​Forms/​ClipboardContentionTests.cs Adds cross-process contention and delayed-rendering tests using native clipboard readers.

Review effort: Balanced

@Shyam-Gupta Shyam-Gupta added test-enhancement Improvements of test source code area-Clipboard Issues related to Clipboard area-test coverage labels Nov 9, 2026
@Shyam-Gupta Shyam-Gupta added this to the 12.0-preview1 milestone Nov 9, 2026
@Shyam-Gupta
Shyam-Gupta marked this pull request as ready for review November 9, 2026 21:16
@Shyam-Gupta
Shyam-Gupta requested a review from a team as a code owner November 9, 2026 21:16
@Shyam-Gupta
Shyam-Gupta merged commit ac8e170 into main Nov 9, 2026
8 checks passed
@Shyam-Gupta
Shyam-Gupta deleted the dev/shgu/clipboard-contention-coverage branch November 9, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Clipboard Issues related to Clipboard area-test coverage test-enhancement Improvements of test source code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants