Skip to content

Parallelizable(ParallelScope.Fixtures) doesn't work on a TestFixture #2253

Closed
@bjharo

Description

@bjharo

I use NUnit for my UI (Selenium) and API (REST Calls) integration tests. I'm currently testing 3.7.1 and my tests are not executing in parallel as they did in 3.6.1. I've gone over the changes in 3.7.1 and the documentation but I can't seem to figure out where the problem lies.

All of my test classes have these attributes:
[TestFixture]
[Parallelizable(ParallelScope.Fixtures)]
or
[TestFixture]
[Parallelizable(ParallelScope.None)]
Most of my test classes are derived from base classes. Those base classes do not have any of the attributes as shown above. On the primary base class, I have a TestAction attribute that executes some code before and after each test.

I execute my tests using the nunit console. Since there isn't a 3.7.1 release of the console, I'm still using 3.6.1. At first I thought this might be the problem, but the comments from this issue lead me to believe that console 3.6.1 should work.

To demonstrate the issue I'm having, I ran two of my test classes against 3.6.1 and 3.7.1 using this command line:

nunit .\Automation.Api.Tests.dll --workers=2 --where="class =~ /.*AddConstituentTest$/ or class =~ /.*AddressEndpointTest$/" --verbose --trace=DEBUG

Both classes are marked as [Parallelizable(ParallelScope.Fixtures)] so I would expect them to execute in parallel. 3.6.1 works as expected whereas in 3.7.1, they execute sequentially. As you can see below, the total duration has increased using 3.7.1.

Output After 3.6.1 Run
Run Settings
DisposeRunners: True
InternalTraceLevel: Debug
WorkDirectory: C:\dev\CRM\Automation\AutoBuild
NumberOfTestWorkers: 2
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.6.1
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
Overall result: Passed
Test Count: 23, Passed: 23, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
Start time: 2017-06-14 18:30:22Z
End time: 2017-06-14 18:30:43Z
Duration: 21.396 seconds

Output After 3.7.1 Run
Run Settings
DisposeRunners: True
InternalTraceLevel: Debug
WorkDirectory: C:\dev\CRM\Automation\AutoBuild
NumberOfTestWorkers: 2
ImageRuntimeVersion: 4.0.30319
ImageTargetFrameworkName: .NETFramework,Version=v4.6.1
ImageRequiresX86: False
ImageRequiresDefaultAppDomainAssemblyResolver: False

Test Run Summary
Overall result: Passed
Test Count: 23, Passed: 23, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
Start time: 2017-06-14 18:36:12Z
End time: 2017-06-14 18:36:43Z
Duration: 31.400 seconds

I have also attached trace log files from both runs. Any help would be appreciated.

361_InternalTrace.5612.Automation.Api.Tests.dll.txt
371_InternalTrace.27432.Automation.Api.Tests.dll.txt

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions