michaellogutov;7615 wrote:
Hm... That not what I meant.
I have a problem - my xUnit test correctly executing when runned from xUnit console runner even with "parallel all" option (which will make all tests within one collection across assembly to run in parallel). This is because xUnit console runner correctly uses Collection attribute which makes all tests inside one collection to not run in parallel.
But when running from nCrunsh my tests randomly fail. If I rerun failed tests one by one they all passing. So I assume nCrunch does not respects the Collection attribute of xUnit framework? Because it should - it's shouldn't be required to decorate tests additionally with ExclusivelyUsesAttribute when choosen unit test framework already supports the notion of controlling parallelization through the attributes.
Sorry - I understand now. You're expecting that NCrunch will make use of the concurrency metadata provided by XUnit.
I'm not entirely sure if such metadata could be cleanly applied to NCrunch's concurrency rules. XUnit parallel execution is multi-threaded in-proc, which means that tests (and the code executed by them) must support multithreaded execution. This same constraint doesn't apply to NCrunch, as NCrunch's parallel execution is multi-process single-threaded. To apply XUnit's concurrency constraints into NCrunch's execution environment would result in many tests being constrained from parallel execution when they could actually be safely run in parallel using multi-process execution.
From what you've described, I suppose this may not be the case for you if your big constraint is out-of-process resources (like a database). So perhaps a configuration switch would make sense as a
feature request if you like.