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
Call assertions sometimes fail for concurrent calls #1460
Comments
Hi @ToniRiegler, Thanks for reporting, we'll look into it. Which framework are you targeting? .NET Framework, .NET Core ? Which version? |
.NET Framework 4.7 |
I can repro after a few iterations (usually less than 50). Looks like a race condition where we record calls. But I'm not sure how it can happen... We're using a |
OK, I found the root cause of the problem. The condition in the
excludes the first call, because it has a higher sequence number than the second. This happens because of a race condition in FakeItEasy/src/FakeItEasy/Core/FakeManager.cs Lines 179 to 183 in 7a5fd74
The race condition is something like this:
Possible fixes:
|
This change has been released as part of FakeItEasy 4.9.1. Thanks, @ToniRiegler! The reproduction instructions were excellent. Look for your name in the release notes. 🏆 |
I'm glad you found it. |
Our pleasure (easy for me to say; @thomaslevesque did the hard work). Happy FakeItEasying. |
There seems to be a bug using MustHaveHappened in combination with Tasks.
Please see my gist:
https://gist.github.com/ToniRiegler/4812345401f582755e876349978151e2
It doesn't happen all of the time, but you can reproduce it easily using NCrunch with Churn selected test until it fails activated.
The Bug is reproducible with FakeItEasy 4.7.1 and 4.9.0 but not with FakeItEasy 2.3.1.
The text was updated successfully, but these errors were encountered: