You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did anyone consider threading issues? Would it be hard to generate serialized access to Mock properties?
I guess Mock could either be generated as actor or it could wrap it's properties using queue.sync { }.
This especially becomes a problem with arrays (i.e. the ...invocations) which leads to EXT_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:
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 😉
@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 queue.sync here and there (in 3x places), feel free to use my template as inspiration.
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: