Daily Usage Issues

XUnit - CollectionBehaviorAttribute to disable parallelism - not used?

Started by kierenj on 8,113 views

Hi, I have some integration tests which I don't want to be run in parallel, using xunit -

I have :

[assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly, DisableTestParallelization = true, MaxParallelThreads = 1)]

Which works fine with most runners, but it seems that NCrunch doesn't pick up on it - is that by design?

Thanks!
Kieren
Hi Kieren,

Thanks for posting!

Yes, this is by design. The dimensions of the Xunit parallelization control are quite different to NCrunch's own implementation, so there is no way for NCrunch to make use of them. To constraint parallel execution under NCrunch you'll need to use ExclusivelyUsesAttribute or Allow Parallel Execution.

Edited

Post a reply

Log in to reply.