Skip to content

feat(assertions): add Expect(callback).ToPassAsync() - #3462

Open
Dmitry Gozman (dgozman) wants to merge 2 commits into
microsoft:mainfrom
dgozman:fix-2314
Open

Dmitry Gozman (dgozman) wants to merge 2 commits into
microsoft:mainfrom
dgozman:fix-2314

Conversation

@dgozman

@dgozman Dmitry Gozman (dgozman) commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Expect(callback).ToPassAsync() retries a Func<Task> or an Action until it passes; options are Timeout (30 seconds by default, SetDefaultExpectToPassTimeout changes it) and Intervals.
  • The NUnit base classes run each attempt in an isolated NUnit context, because NUnit fails a test for an assertion failure that was caught.
  • Every attempt runs on the thread pool, also when a handler calls ToPassAsync on the dispatcher thread.
  • Stacked on the roll in chore(driver): roll to 1.66.0-next (8534271f0) #3464, which brings the generated API; the first commit goes away once that merges.

Fixes #2314

This branch has not been deployed

No deployments
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.

[Feature] Add Expect.Poll

2 participants