Comments (9)
Could this be related to the fix @yonahw contributed in pull #36 ?
from moq4.
I don´t think so. The InvokeBase Interception strategy is still called under lock conditions and the lock is still made on "Mock". I believe executing the InvokeBase strategy under lock conditions is causing the deadlock. Unfortunately I do not have the time to verify that right now. Maybe I can can try to fix it on the weekend.
from moq4.
I didn't have time to run test myself but doesn't seem related on the surface.
from moq4.
weird thing is that there was no other change related to locking, so I
wonder how could the behavior change so drastically (do we know it's
different than before?)
/kzu
Daniel Cazzulino
On Thu, Apr 25, 2013 at 10:02 AM, Yonah Wahrhaftig <[email protected]
wrote:
I didn't have time to run test myself but doesn't seem related on the
surface.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/47#issuecomment-17005259
.
from moq4.
In my opinion this behavior was introduced when fixing issue #3. As far as I can tell (I´m still not so familiar with github) the lock was introduced to resolve the threading issue when calling methods on a mock from different threads in parallel. The lock is just covering to much. It is calling "foreign" code under lock conditions, what always is dangerous. But on the other hand it could very well be that I´m missing something here and I´m completely wrong .... that happens from time to time :)
from moq4.
@FelicePollano did you have a chance to look at this?
from moq4.
Full immersion until the end of the month.
Felice Pollano
Senior IT Architect & Developer
http://www.felicepollano.com
From: "Daniel Cazzulino" [email protected]
To: "Moq/moq4" [email protected]
Cc: "Felice Pollano" [email protected]
Date: Mon, 27 May 2013 08:17:33 -0700
Subject: Re: [moq4] Deadlock in Interceptor (#47)
@FelicePollano did you have a chance to look at this?
—> Reply to this email directly or view it on GitHub.
from moq4.
I thought I have a look at the code and try to fix it. Got the code from gitHub and build the whole thing (VS 2012). But somehow almost all UnitTest are failing with:
System.TypeInitializationException
The type initializer for 'Moq.Mock1' threw an exception. at Moq.Mock
1.b__0() in Mock.Generic.cs: line 138
at Moq.PexProtector.Invoke(Action action) in PexProtector.cs: line 56
at Moq.Mock1.InitializeInstance() in Mock.Generic.cs: line 136 at Moq.Mock
1.OnGetObject() in Mock.Generic.cs: line 153
at Moq.Mock.GetObject() in Mock.cs: line 152
at Moq.Mock.get_Object() in Mock.cs: line 147
at Moq.Mock1.get_Object() in Mock.Generic.cs: line 131 at Moq.Tests.AsInterfaceFixture.GetMockFromNonAddedInterfaceThrows() in AsInterfaceFixture.cs: line 120 System.TypeInitializationException The type initializer for 'Moq.Proxy.CastleProxyFactory' threw an exception. at Moq.Proxy.CastleProxyFactory..ctor() at Moq.Mock
1..cctor() in Mock.Generic.cs: line 54
System.IO.FileLoadException
Could not load file or assembly 'Castle.Core, Version=2.5.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at Moq.Proxy.CastleProxyFactory..cctor()
Obviously I miss something here ... any hints?
from moq4.
I've added pull request #68 that fixes this problem, i've used the code asmus attached as test for the fix.
from moq4.
Related Issues (20)
- Strange System.UnauthorizedAccessException during build using latest version HOT 4
- SponsorLink is now OSS too and no longer bundled HOT 87
- Trouble to unit test a lambda expression with Moq HOT 1
- Default value ILookup<> in loose mode is `null` HOT 2
- Using 'Verify' and 'It.Is<>' with a method call inside cases the same verify the run for all invocations HOT 6
- Permanently delete all data from SponsorLink's database that has been collected during builds that included Moq (notably any version 4.20.*) HOT 18
- Stop using Moq as a guinea pig to get feedback on and develop SponsorLink HOT 105
- Support Static Abstract property HOT 1
- Community Involvement HOT 5
- Change log is not updated since version 4.18.4 HOT 3
- Mocking Blobclient.DownloadContentAsync() HOT 3
- Poll on SponsorLink HOT 1
- Should allow null references as constructor parameters. HOT 1
- Replacement for Moq.MethodCallReturns'2 HOT 3
- The public API is still missing nullable reference type annotations HOT 1
- a minor changes to improve the readability HOT 2
- Mock verification slow with It.Is(Expression) HOT 5
- [Feature Request] Make it possible to moq concrete classes HOT 1
- Moq dependency uprev is not working as expected HOT 1
- SponsorLink Integration Makes Moq Unuasable due to PII and GDPR Requirements HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moq4.