Closed cmeyertons closed 4 months ago
To be clear... the entire TestKit operates without Orleans concurrency guarantees. From the README:
The simulated grain activation context does not provide the single-threaded execution model of the Microsoft Orleans runtime. It is up to you to ensure the grain activation is used appropriately. Unfortunately, this may result in abnormal method execution or behaviors that are impossible to reproduce, especially in reentrant grains.
From the PR description and based on the new test added, it sounds like the SUT is not a grain activation, but instead some other service depending on IClusterClient
. This is outside the scope of the TestKit. Instead the service should make use of its own test double/fake/mock that does not rely on a TestKit-created grain activation.
Please let me know if I'm misunderstanding something, but this looks undesirable for the TestKit.
This still appears to be out of scope for the TestKit. Closing for now, but happy to re-evaluate if there's more to discuss.
The
TestGrainFactory
can be invoked outside the Orleans thread-safety guarantees in a parallel fashion by code that is invoking viaIClusterClient
and should offer functionality for concurrency guarantees.I received an error in some new code in our codebase that we had to re-shape business logic to satisfy the unit test error