Skip to content

Comments

[Testing] Replace Thread.Sleep with retryTimeout in UI tests#33809

Draft
Copilot wants to merge 2 commits intonet11.0from
copilot/create-pr-with-copilot-suggestions
Draft

[Testing] Replace Thread.Sleep with retryTimeout in UI tests#33809
Copilot wants to merge 2 commits intonet11.0from
copilot/create-pr-with-copilot-suggestions

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Applies Copilot code review suggestions from PR #33749 to net11.0. Replaces fixed Thread.Sleep delays with adaptive retryTimeout parameters that retry screenshot comparisons until they match or timeout.

Changes

  • 9 UI test files: Replace Thread.Sleep/Task.Delay with retryTimeout parameter
  • Issue18751.cs: Add comment explaining CollectionView vs ListView timing differences (addresses Copilot review noting inconsistency with Issue18896)
  • Issue10563.cs: Add comment clarifying retryTimeout (not tolerance) for animation timing per UI testing guidelines

Example

// Before
Thread.Sleep(1000);
VerifyScreenshot();

// After
VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(2));

Files Changed

File Change
Issue10563 retryTimeout 2s→3s + guideline comment
Issue18751 Task.Delay→retryTimeout + CollectionView timing comment
Issue18857, Issue24856, Issue25192 Thread.Sleep→retryTimeout
Issue27418 Remove #if WINDOWS Sleep, use cross-platform retryTimeout
Issue28657, Issue30575 Thread.Sleep→retryTimeout
Issue18896 Thread.Sleep→retryTimeout + ListView timing comment
Original prompt

Create a PR with the suggestions of copilot review and create a new PR with these changes to nett11.0 branch


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Replace Thread.Sleep with retryTimeout in UI tests per guidelines
- Add comment explaining CollectionView vs ListView timing differences (Issue18751 vs Issue18896)
- Add comment clarifying retryTimeout (not tolerance) for SwipeView animation timing
- Increase SwipeView retryTimeout to 3s for animation completion

Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
Copilot AI changed the title [WIP] Create pull request with Copilot review suggestions [Testing] Replace Thread.Sleep with retryTimeout in UI tests Jan 31, 2026
Copilot AI requested a review from rmarinho January 31, 2026 02:11
@PureWeen
Copy link
Member

@rmarinho

Might be good to grab this one that just got merged to main
#33749

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.

3 participants