Skip to content

Enable parallelism in test projects - #5697

Open
rbev wants to merge 15 commits into
masterfrom
rhys/test-parallel
Open

Enable parallelism in test projects#5697
rbev wants to merge 15 commits into
masterfrom
rhys/test-parallel

Conversation

@rbev

@rbev rbev commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces parallelization settings for NUnit test projects and marks specific acceptance test classes as non-parallelizable to avoid concurrency issues. The main changes are grouped into test project configuration updates and test class attribute adjustments.

Test Project Configuration:

  • Added assembly-level NUnit attributes to NUnitSettings.cs in both src/Particular.LicensingComponent.UnitTests and src/ServiceControl.AcceptanceTests.RavenDB to enable parallel test execution with ParallelScope.All and a maximum level of parallelism set to 4.

Test Class Attribute Adjustments:

  • Marked all CORS-related acceptance test classes in src/ServiceControl.AcceptanceTests/Security/Cors as [NonParallelizable] to prevent parallel execution and potential test interference.
  • Marked all Forwarded Headers-related acceptance test classes in src/ServiceControl.AcceptanceTests/Security/ForwardedHeaders as [NonParallelizable] for test isolation.
  • Marked the HTTPS test class When_hsts_is_configured_in_development_mode as [NonParallelizable].

@rbev
rbev force-pushed the rhys/test-parallel branch from 7bac798 to f747755 Compare August 4, 2026 08:03
@rbev
rbev marked this pull request as draft August 4, 2026 08:32
@rbev
rbev force-pushed the rhys/test-parallel branch from 28b6e7d to 20f562d Compare August 5, 2026 06:08
@rbev
rbev marked this pull request as ready for review August 5, 2026 08:04
@johnsimons

Copy link
Copy Markdown
Member

Should we just use the default for LevelOfParallelism https://docs.nunit.org/articles/nunit/writing-tests/attributes/levelofparallelism.html, which mean not using the attribute?

@rbev

rbev commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Should we just use the default for LevelOfParallelism https://docs.nunit.org/articles/nunit/writing-tests/attributes/levelofparallelism.html, which mean not using the attribute?

I removed the explicit setting and it ran much slower, the build agents don't have 4 cores and benefit from having higher parallelism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants