-
Notifications
You must be signed in to change notification settings - Fork 289
Closed
Labels
Area: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Issues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Needs: Additional Info
Description
Describe the bug
I am trying to upgrade to MSTest. This are the package changes I am now making

after upgrading some tests start to fail; it almost feels like objects created in the TestInitialize are not matched up with the right test (as if i get different variable values).
example
private Mock<MyObject> _mock;
[TestInitialize]
public async Task Initialize()
{
await Task.Delay(100); // just for demo
_mock = new Mock<MyObject>();
}
[TestMethod]
public async Taks ExecuteTestAsync()
{
_mock.Object.DoSomething();
}
When running my test the results are everything different with verifying the number of method invocations; Sometimes too much, sometimes not enough; but never consisted. When I add DoNotParallize it's already more stable but still 'random' results while these problems didnt exist before 3.9
Looking for some advice how to further diagnose this.
Steps To Reproduce
Looking for help to understand how to debug this?
Expected behavior
Test showing same before as version 3.8.3
Actual behavior
Test are flaky and unpredictable
Metadata
Metadata
Assignees
Labels
Area: MSTestIssues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Issues with MSTest that are not specific to more refined area (e.g. analyzers or assertions)Needs: Additional Info