I have several suites of integration tests implemented in C#/NUNit. Each test suite is a separate class, each fixture setup creates and populates a SQL Server database from scripts. This all used to work just fine prior to Resharper 5.1.
Unfortunately, Resharper 5.1 begins to run several fixtures at the same time. This is a breaking change - they are all attempting to create and populate the same database, which obviously ends up in an mess. Is there any way I could have Resharper run my test fixtures serially?
If not, what would you suggest to run my NUnit test fixtures serially, one fixture at a time? The order in which individual tests run does not matter.
Ordered tests are started in ascending order of the order argument. Among tests with the same order value or without the attribute, execution order is indeterminate. Tests do not wait for prior tests to finish. If multiple threads are in use, a test may be started while some earlier tests are still being run.
Parallel execution is supported by the NUnit framework on desktop . NET runtimes and . NET Standard 2.0.
I don't know whether it is possible to prevent ReSharper from running tests in parallel; if not, the following hack might work: Create a static class with a static readonly Monitor
member. Then, in [TestFixtureSetUp]
, call Enter()
on the monitor, and call Exit()
on the monitor in [TestFixtureTearDown]
. That way, only one test fixture will be allowed to run at a time. Not pretty, though...
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