Skip to content

Enable safe TemplateEngine test parallelization - #55993

Open
Evangelink wants to merge 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/template-utility-audit
Open

Enable safe TemplateEngine test parallelization#55993
Evangelink wants to merge 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/template-utility-audit

Conversation

@Evangelink

Copy link
Copy Markdown
Member

These TemplateEngine test projects currently run serially despite having independent test-class fixtures. This opts them into conservative class-level parallelism so independent classes can overlap without exposing method-scoped shared state to concurrency.

Summary

  • Enable MSTestParallelizeScope=ClassLevel in five TemplateEngine utility, search, localization, edge, and discovery test projects.
  • Preserve serial execution within classes that share settings helpers, mutable providers, package-manager state, culture-sensitive fixtures, fixed package outputs, or custom hives.
  • Avoid broad resource locks and DoNotParallelize because the audited shared state is contained within individual classes.

Validation

Local test and benchmark execution was intentionally deferred so the change can be measured in the coordinated 10-run baseline/changed full-fleet benchmark after integration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 28, 2026 15:20
@Evangelink
Evangelink requested a review from a team as a code owner August 28, 2026 15:20
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

Review tier: Lite
Findings: None

What changed in this PR

This PR opts five TemplateEngine MSTest.Sdk test projects into conservative class-level parallel execution by overriding the repo default (test/Directory.Build.props sets MSTestParallelizeScope=None). The intent is to allow independent test classes to overlap while keeping methods within each class serialized to avoid class-scoped shared state conflicts.

Changes:

  • Set <MSTestParallelizeScope>ClassLevel</MSTestParallelizeScope> in five TemplateEngine test .csproj files.
  • Add explanatory comments in each project file describing the intended isolation/serialization boundary (methods serialized within a class; classes may run concurrently).
File Description
test/​TemplateEngine/​Microsoft.TemplateSearch.TemplateDiscovery.IntegrationTests/​Microsoft.TemplateSearch.TemplateDiscovery.IntegrationTests.csproj Enables MSTest class-level parallelization for template discovery integration tests while keeping per-class method runs serial.
test/​TemplateEngine/​Microsoft.TemplateSearch.Common.UnitTests/​Microsoft.TemplateSearch.Common.UnitTests.csproj Enables class-level parallelization for TemplateSearch common unit tests, preserving class-internal serialization for shared fixtures.
test/​TemplateEngine/​Microsoft.TemplateEngine.Utils.UnitTests/​Microsoft.TemplateEngine.Utils.UnitTests.csproj Enables class-level parallelization for TemplateEngine utils unit tests across TFMs, keeping method runs serial within each class.
test/​TemplateEngine/​Microsoft.TemplateEngine.TemplateLocalizer.Core.UnitTests/​Microsoft.TemplateEngine.TemplateLocalizer.Core.UnitTests.csproj Enables class-level parallelization for TemplateLocalizer core unit tests with method serialization within each class.
test/​TemplateEngine/​Microsoft.TemplateEngine.Edge.UnitTests/​Microsoft.TemplateEngine.Edge.UnitTests.csproj Enables class-level parallelization for TemplateEngine edge unit tests, preserving class-internal serialization for shared state.

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