I would like to have some support for finding problems with tests running concurrently.
When testing complex applications, it happens that some parts of the code unintentionally access shared resources during unit tests (e.g. writing/reading to a common config file). This makes tests failing unpredictably. The experienced result is usually:
- if you run only the failing test, it works like a charm.
- if you run all tests, one or some tests are failing for strange reasons.
- often, if you turn off parallel test execution, the problem vanishs.
In my experience, the error is often not clearly visible, e.g. since the place where the code fails is totally off the screen of the shared resource access. (Or in other words, if it would be that simple, it would have been mocked away already).
I propose a feature in NCrunch, where you can re-run in Debug mode the exact same test run setup that just ran. NCrunch should log at which thread which test case ran in which order and provide a way to re-run the last execution (that triggered because of the last edit operation), just this time in debug mode, stopping at exceptions and break points.