I am using Visual Studio 2017 Enterprise and MSTest V2. My solution has multiple Unit Test projects. In one project, I have unit tests that are testing the loading of resources from the installation directory. Most test that the resources are loaded correctly, but some delete the resource to confirm that this is handled correctly as well.
The issue that I am having is that the tests run in parallel. Therefore, the tests that remove the resources do this at the same time the tests that are loading the resources are running, and I get failed tests.
I realize I can resolve this by updating my code to send the directory to search, or by running one set of tests and then the next, but I would prefer being able to run all tests at once. It sounds like MSTest v2 is supposed to run sequentially unless otherwise directed to run in parallel, but on my system, this is demonstrably false. It also appears that Ordered Test does not work with v2. Is there a way to get MSTest V2 to run sequentially?
I would say that you can create a flag and update that from dependent test, check for the flag status before cleaning up resource. may be a dictionary of testname and status, once its done, execute this test or wait for that test to complete. you can implement a custom logic for that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With