Skip to content

Don't throw when delay is expedited in tests#57631

Merged
genlu merged 2 commits intodotnet:mainfrom
genlu:NoThrowAwait
Nov 10, 2021
Merged

Don't throw when delay is expedited in tests#57631
genlu merged 2 commits intodotnet:mainfrom
genlu:NoThrowAwait

Conversation

@genlu
Copy link
Member

@genlu genlu commented Nov 8, 2021

To reduce the number of first chance exceptions in tests, which make it easier for existing tools to detect regression in number of exceptions thrown during tests.

For example, this change eliminated 7,000+ TaskCancelledException in the typing RPS test.

@ghost ghost added the Area-IDE label Nov 8, 2021
/// <summary>
/// An awaitable that wraps a task and never throws an exception when waited on.
/// </summary>
public readonly struct NoThrowTaskAwaitable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

own file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be better to keep copied code together? But I'm fine either way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you prefer that, then that's fine :)

@genlu genlu marked this pull request as ready for review November 9, 2021 17:59
@genlu genlu requested a review from a team as a code owner November 9, 2021 17:59
@genlu genlu changed the title Don't throw when cancelled Don't throw when delay is expedited in tests Nov 9, 2021
@genlu
Copy link
Member Author

genlu commented Nov 9, 2021

@sharwell this is ready for review. Please take another look, thanks!

@genlu genlu merged commit d5d921f into dotnet:main Nov 10, 2021
@ghost ghost added this to the Next milestone Nov 10, 2021
@genlu genlu deleted the NoThrowAwait branch November 10, 2021 18:45
@allisonchou allisonchou modified the milestones: Next, 17.1.P2 Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants