-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Cosmos provider throw for sync I/O #33386
Conversation
Fixes #32563 This change adds an error via logging which is thrown on any use of sync I/O with Cosmos. This can currently be disabled to allow sync again, but ultimately this will be removed--probably in 11. Also, makes all test infrastructure async-only. This means an EF provider only needs to support async APIs to use our test infra.
@@ -43,7 +43,7 @@ public virtual void Values_arent_compared_by_reference() | |||
} | |||
|
|||
[ConditionalFact] | |||
public virtual void Mutation_of_tracked_values_does_not_mutate_values_in_store() | |||
public virtual async void Mutation_of_tracked_values_does_not_mutate_values_in_store() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajcvickers this means that the test cannot be overridden to e.g. catch an exception (in PG...); I'm actually not too sure how xunit can even run async void tests... Was there a specific reason to use async void here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Async void tests are bad! They are one of things that cause test flakiness.
With regard to overriding, I typically just skip the sync path and only test the async if an exception is expected. There are a lot of examples of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xUnit analyzers don't catch this because they don't run for derived attributes: xunit/xunit#1963
Filed #34536
Fixes #32563
This change adds an error via logging which is thrown on any use of sync I/O with Cosmos. This can currently be disabled to allow sync again, but ultimately this will be removed--probably in 11.
Also, makes all test infrastructure async-only. This means an EF provider only needs to support async APIs to use our test infra.