Search code examples
nunitnunit-3.0nunit-console

NUnit3 Tests Don't seem to be running in parallel


I have the following

[assembly: LevelOfParallelism(10)]

[Parallelizable(ParallelScope.Self)]
public class MessageHandlerTests
{
    [Test]
    public async Task WhenCallingHandle_ShouldInvokeConsumer(
        [Values(1, 25)] int messageCount,
        [Values(5, 12)] int processingTimeSeconds,
        [Values(SendMode.AzureServiceBus, SendMode.BrokeredMessageSender)] SendMode sendMode,
        [Values(ConsumerAction.None, ConsumerAction.Publish, ConsumerAction.Reply, ConsumerAction.Send)] ConsumerAction consumerAction)
    {
    ...
    }
}

It's a semi long running test (about 30 seconds) and I have logging throughout the test and as far as I can tell it's not running in parallel, either via Test Explorer or via nunit3-console.exe

Any ideas on what I'm doing wrong?


Solution

  • Resolved this by setting

    [Parallelizable(ParallelScope.All)]
    

    Issue seems to be an unexpected behavior when using combinatorial tests. Note this is a newly added enum value.