Skip to content
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

Merged
merged 1 commit into from
Mar 25, 2024
Merged

Conversation

ajcvickers
Copy link
Contributor

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.

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.
@ajcvickers ajcvickers requested a review from a team March 24, 2024 14:25
@ajcvickers ajcvickers merged commit eb0c2d2 into main Mar 25, 2024
7 checks passed
@ajcvickers ajcvickers deleted the 240314_NoMoreQueues branch March 25, 2024 14:20
@@ -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()
Copy link
Member

@roji roji Aug 24, 2024

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?

Copy link
Contributor Author

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.

Copy link
Member

@AndriySvyryd AndriySvyryd Aug 26, 2024

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

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.

Throw for sync APIs when using Cosmos since they do sync over async
4 participants