Is the code under test paralellized? On Fri, Jun 18, 2010 at 12:13 PM, Caio Kinzel Filho <[email protected]>wrote:
> Hello guys, > > Do you know if MockRepository is thread-safe? > > I have some code here using an instance of MockRepository (new > MockRepository()) to set some Ordered and Unordered expectations. > The expectations are meant to be met by some code that will call the > mocks in parallel (using .NET 4 features). > My code and (especially) my tests work fine when I run them in a > single core environment (and test pass), but when I run them on a > multi-core machine, the expectations are not met (and test fail). Is > it supposed to work? Is it a known issue? Could I be doing something > wrong? > > My test flow is as follows: > > - create mockRepository and mocks > - set expectations (ordered and unordered) > - mockRepository.ReplayAll() > - call the expected methods on the mocks - in parallel (and here I'm > sure I am calling all the expected methods) > - wait for a bit (surely enough for the parallel threads to finish) > - mockRepository.VerifyAll() - expectations FAIL > > > Thanks, > Caio > > -- > You received this message because you are subscribed to the Google Groups > "Rhino.Mocks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<rhinomocks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rhinomocks?hl=en. > > -- Tim Barcz Microsoft C# MVP Microsoft ASPInsider http://timbarcz.devlicio.us http://www.twitter.com/timbarcz -- You received this message because you are subscribed to the Google Groups "Rhino.Mocks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en.
