- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 810
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
Thread safety #1
Conversation
…ded a unit test commented to show the previous version was not thread safe.
First pull request for the Moq4 line... nice! Before I pull, I'm going to verify with Daniel what our strategy is with this. Clearly he is thinking about a clean start with Moq5. I'm more interested at this point at getting a Moq4 maintenance release out. There are a couple of things I'd like to do before modifying the existing code base such as getting it running under CI etc. Leave it with me, will get back to you soon (ish) |
Thank you Damian. This is perfectly OK. I will push in the maintenance repo if you/Daniel agree, because I think this is useful ( even in MoQ 5 it would be nice ) Current push is thread safe at the infrastructure level, and this worked for me. I'm just doing an adjustement, that I think is necessary ( and maybe you would consider even in Moq 5) to setup the moq to be SingleThreaded ( in a per method base ) so you can ensure the SUT is calling such a method/property not in multithread ( this is usefule when the actual object isn't thread safe and you want to ensure it is called single threaded ) |
I guess I missed the notifications here because this was on another repo before :) I'd make the Moq infrastructure itself thread safe. |
Also, the pull requests should go against dev branch (just created it). |
Thank you Daniel, Felice Pollano http://www.felicepollano.comDa: "Daniel Cazzulino" reply@reply.github.com
|
I think we should separate the previous pull request (just fixing the multi-threading) from the SingleThreaded extension method. (I'm not so sure about the usefulness of that in the "core" moq). Also, any chance you can keep the tab/spaces on the file intact? it's hard to diff in github site when those are changed. The entire file just appears deleted/added :( |
Gents (slightly OT here), when you run the build script / run the unit tests in VS what is your test count? |
@danielkzu I will fix this with a new pull, I'm sorry, I wiull check in a private repo to see the proper cr-lf config. For sure the two pull request are separated, the SingleThreaded version maybe is just useful to me, in this case forget about it I will keep it in my private fork :) |
@damianh I do use the xUnit external GUI ( I'have not resharper ) anyway My test count is 606 total ( 4 are mine for the mt stuff ) 9 test appear to be skipped. Additionally, there is another test that requires office interop that I have #ifdeffed out on my fork. Hope this help :) |
Closing! Fix the CR-LF stuff and work on the proper trunk |
Please I'm a bit confused on the crlf stuff: http://help.github.com/line-endings/ My current git settings are AutoCrlLf on and SaveCrLf ON, please tell me the correct ones :) |
Should be all false,
|
Thank you, I retryed the pull with that settings and should be ok now :) I'm interested in opinion about the SelfThread() expectation. You can point for opinions my post if you want. |
Merge master into netcore for PR
T4-generated overloads for ReturnsAsync(Func<T1, T2, ... TResult> value)
Hi Damian,
I added thread safety support. There is also a new unit test show it works ( other test still passes ;) )
Please let me know if you like it.
Thanks!