Skip to content

Remove redundant [DoNotParallelize] from serialized test projects#55091

Merged
Evangelink merged 1 commit into
mainfrom
dev/amauryleve/remove-redundant-donotparallelize
Jul 1, 2026
Merged

Remove redundant [DoNotParallelize] from serialized test projects#55091
Evangelink merged 1 commit into
mainfrom
dev/amauryleve/remove-redundant-donotparallelize

Conversation

@Evangelink

Copy link
Copy Markdown
Member

What

Remove redundant class-level [DoNotParallelize] attributes from 56 test files.

Why they are no-ops today

Every affected project inherits the repo-wide default in test/Directory.Build.props:

<MSTestParallelizeScope>None</MSTestParallelizeScope>

None makes MSTest.Sdk emit [assembly: DoNotParallelize], which already fully serializes the entire assembly. A class-level [DoNotParallelize] on top of that changes nothing, so these attributes are dead configuration.

Removing them reduces noise and prevents the false impression that a specific class has a concurrency hazard being guarded. If a project ever opts in to parallelization (as done for the true unit-test projects in #55090), the guard should be re-added deliberately, next to a comment explaining the shared state it protects.

Kept intentionally

Three classes that document a real concurrency hazard keep their [DoNotParallelize] and are not touched:

Scope

Affects Containers integration tests, dotnet-new integration tests, Razor, StaticWebAssets, and the TemplateEngine test suites. Pure attribute deletions — no behavior change (assemblies remain serialized via the None default). A representative TemplateEngine unit-test project builds clean (0 warnings) after the change.

These test projects inherit the repo-wide MSTestParallelizeScope=None default
from test/Directory.Build.props, which already emits [assembly: DoNotParallelize]
and fully serializes the assembly. The class-level [DoNotParallelize] attributes
are therefore no-ops. Remove them to reduce noise; if a project ever opts in to
parallelization, the guard should be added deliberately with a documented reason.

The three classes that document a specific concurrency hazard (process CWD /
environment-variable mutation) keep their [DoNotParallelize] and are not touched.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 09:57
@Evangelink Evangelink requested review from a team as code owners July 1, 2026 09:57

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.

Pull request overview

Removes redundant class-level [DoNotParallelize] attributes from MSTest.Sdk-based test projects that are already assembly-serialized via the repo’s test/Directory.Build.props default (<MSTestParallelizeScope>None</MSTestParallelizeScope>), reducing noise without changing current execution semantics.

Changes:

  • Deleted class-level [DoNotParallelize] attributes from multiple TemplateEngine unit/integration test classes.
  • Deleted class-level [DoNotParallelize] attributes from selected StaticWebAssets, Razor, Containers integration, and dotnet-new integration test classes.
  • Kept project-level serialization intact (these projects are Sdk="MSTest.Sdk" and inherit/override MSTestParallelizeScope=None, so MSTest remains non-parallel at the assembly level).
Show a summary per file
File Description
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValueFormTests/TemplateJsonDefinedFormsTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValueFormTests/FirstUpperCaseValueFormTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValueFormTests/FirstUpperCaseInvariantValueFormModel.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValueFormTests/FirstLowerCaseValueFormTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValueFormTests/FirstLowerCaseInvariantValueFormTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ValidationTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/TemplateConfigTests/TemplateRootTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/TemplateConfigTests/SplitConfigurationTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/TemplateConfigTests/SourceConfigTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/TemplateConfigTests/PostActionTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/TemplateConfigTests/LocalizationTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/TemplateConfigTests/FileRenameTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/SnapshotTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/ScanTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/RunnableProjectGeneratorTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/RunnableProjectConfigTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/SwtichMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/RegexMatchMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/RegexMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/RandomMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/NowMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/JoinMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/GuidMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/GeneratePortMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/FakeMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/EvaluateMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/ConstantMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/CoalesceMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroTests/CaseChangeMacroTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/MacroProcessorTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Orchestrator.RunnableProjects.UnitTests/BindSymbolTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.IDE.IntegrationTests/SnapshotTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.IDE.IntegrationTests/LocalizationTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.IDE.IntegrationTests/End2EndTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.IDE.IntegrationTests/ConfigurationTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.IDE.IntegrationTests/BasicTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Edge.UnitTests/TemplatePackageManagerTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Edge.UnitTests/TemplateCreatorTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Edge.UnitTests/FolderInstallerTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Authoring.TemplateVerifier.UnitTests/VerificationEngineTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Authoring.TemplateVerifier.IntegrationTests/VerificationEngineTests.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Authoring.TemplateVerifier.IntegrationTests/TemplateEngineSamplesTest.cs Remove redundant class-level [DoNotParallelize].
test/TemplateEngine/Microsoft.TemplateEngine.Authoring.TemplateVerifier.IntegrationTests/ExampleTemplateTest.cs Remove redundant class-level [DoNotParallelize].
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsPropsFileMultiThreadingTest.cs Remove redundant class-level [DoNotParallelize] (assembly already serialized).
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsManifestMultiThreadingTest.cs Remove redundant class-level [DoNotParallelize] (assembly already serialized).
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ComputeReferenceStaticWebAssetItemsTest.cs Remove redundant class-level [DoNotParallelize] (assembly already serialized).
test/Microsoft.NET.Sdk.Razor.Tests/FindAssembliesWithReferencesToMultiThreadingTest.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).
test/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).
test/Microsoft.NET.Build.Containers.IntegrationTests/ParseContainerPropertiesTests.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).
test/Microsoft.NET.Build.Containers.IntegrationTests/LayerEndToEndTests.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).
test/Microsoft.NET.Build.Containers.IntegrationTests/EndToEndTests.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).
test/Microsoft.NET.Build.Containers.IntegrationTests/DockerRegistryTests.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).
test/Microsoft.NET.Build.Containers.IntegrationTests/CreateNewImageTests.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).
test/Microsoft.NET.Build.Containers.IntegrationTests/CreateImageIndexTests.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).
test/dotnet-new.IntegrationTests/TemplateEngineSamplesTest.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).
test/dotnet-new.IntegrationTests/DotnetNewLocaleTests.cs Remove redundant class-level [DoNotParallelize] (inherits repo MSTest serialization).

Copilot's findings

  • Files reviewed: 56/56 changed files
  • Comments generated: 0

@Evangelink Evangelink enabled auto-merge July 1, 2026 10:11
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.

3 participants