-
Notifications
You must be signed in to change notification settings - Fork 731
Keep synchronization context of executing thread when asserting asynchronous operations #1324
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
Conversation
|
Hey @dennisdoomen and @jnyrup , the PR is ready for review. |
Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs
Show resolved
Hide resolved
jnyrup
left a comment
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.
Nothing strikes out to me, but as mentioned in Slack discussions this is not my strongest topic.
I assume we have the complementary async tests for the removed sync tests.
If I e.g. have existing code that for whatever reason mixes sync and async code, can this PR make it deadlock on a CI-build, where it would previously have passed?
Src/FluentAssertions/Specialized/GenericAsyncFunctionAssertions.cs
Outdated
Show resolved
Hide resolved
Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs
Show resolved
Hide resolved
Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs
Outdated
Show resolved
Hide resolved
Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs
Show resolved
Hide resolved
Tests/FluentAssertions.Specs/Exceptions/AsyncFunctionExceptionAssertionSpecs.cs
Show resolved
Hide resolved
@lg2de Do you have any comments on this case? |
I thought, we had already discussed this. |
|
We might already have discussed it, in which case it simply has slipped my mind. |
|
Shall we squash this PR or do you plan to clean-up the commits so we can keep some history? |
|
All the recent cleanups I collected into single (force-pushed) "cleanup commit". In total we have 5 commits in this PR. I hope this is ok. It shows the development steps. |
|
Now I'm wondering whether we should ship this as an alpha version... |
As discussed on slack
SynchronizationContext.Currentshould not be changed by FluentAssertions.In addition synchronous and asynchronous operations should not be mixed.
Please note the following articles: