-
-
Notifications
You must be signed in to change notification settings - Fork 603
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
[QUESTION] Thread-Safe Mocks #1275
Comments
hey, many companies just take the default macro we bundle and tweak them so there really isn't much stopping you from doing so, if you do then you could add a variant of the template as a pr 😉 |
@pklapuch I ended with the same issue. Did you starting work on a PR about that ? |
@Greensource I did come up with a naive but working solution (I'm terrified of stencil :P also hate it...) - it pretty much came to adding |
Hi,
Did anyone consider threading issues? Would it be hard to generate serialized access to Mock properties?
I guess
Mock
could either be generated asactor
or it could wrap it's properties usingqueue.sync { }
.This especially becomes a problem with arrays (i.e. the
...invocations
) which leads toEXT_BAD_ACCESS
but can have undefined behavior with just about any read/write property.. which leads to inconsistent state at the end of the test.(I guess most tests are simple and run in isolated/serialized context, but now and then we have features that support concurrent execution and that becomes a problem).
In these cases I either end up creating custom Mocks or I extend generated mock, override methods and wrap them with
queue.sync
etc...Any suggestions would be welcome :)
Thanks!
The text was updated successfully, but these errors were encountered: