Not sure you'd want this here, but it's kind of related.
We have a code-base that's been using NCrunch for it's tests for a couple few years now, and today I upgraded to 3.23.0.10 and all of a sudden I'm getting random deadlocks with my tests.
Seems that if some happen to run together that change things in my DBContext then the deadlocks occur. So, if you run one separately it looks ok. If I add ExclusivelyUses("Database") it works okay. But I have a LOT of tests, I'd rather not add the attribute to each.
Is there some behaviour change with this update or a new global setting I need to change so that it behaves as before? I'm not sure how concurrent tests weren't deadlocking each other before and now seem to be.
Here is how I set up my test classes that have these DBContext interactions:
Code:
private TransactionScope _ts;
[TestInitialize]
public void TestInitialize()
{
_ts = new TransactionScope();
}
[TestCleanup]
public void TestTearDown()
{
_ts.Dispose();
}