Is there a way to *prevent* ReSharper from running an assembly's unit tests in parallel?

Go To


I see an option in the Unit Testing settings to "Run up to 1|2" assemblies in parallel", but setting this to "1" still seems to execute a single assembly's tests in parallel. Is there a way to disable parallel execution altogether?

This is ReSharper 6.1.

2012-04-04 18:28
by arathorn
Why would you want this - NoName 2012-04-04 18:29
Sometimes I need to debug the unit test (maybe because the test is not simple enough, tests more than one thing, etc. etc. whatever) And personally I find it difficult to debug the code when other threads are running in parallel. That might be a reason - Ali Ferhat 2012-04-04 18:42
I run multiple unit tests outside debugger. If I want to debug a particular unit test, I start only that unit test - surfen 2012-04-04 18:46
@surfen oops. I find it difficult to debug unit test code when my code to be tested has concurrency itself. Which is a different problem of course - Ali Ferhat 2012-04-04 18:50
How do you reproduce this? FWIW, the Why would you want this? question is extremely important to a good answer here - Austin Salonen 2012-04-04 21:35
You'd want this because your test is doing weird things. I've run into an issue using reflection on test assemblies on the file system. Namely, reflecting on the executing assembly gives 'Could not load file or assembly' if another test is executing, but runs fine if it's just the one - Rob Rodi 2012-04-05 17:09
My project has a bunch of integration tests that create records on the database (which are cleaned up in teardown). Creating isolated transactions solely for tests is currently not something we wish to do, and so parallel tests are randomly ruining results - Mike Asdf 2013-04-23 16:21


You can try looking at the stack overflow answer here How to run NUnit test fixtures serially?

However, it would seem that your need to do this might be fuelled by test dependencies. Either the need to access common resources or the output of one test needing to be the input of another. If this is the case, please consider refactoring your test/code in order to remove the dependency. Commonly this can be done by using a mocking framework (Moq, RhinoMocks, etc).

2012-04-17 09:13
by pms1969
@BartRead where's your "answer below"? this seems to be your only comment in this threa - Ismael 2016-12-28 19:26