Repository navigation
Parallelize Blazor and static web asset tests - #56029
Conversation
Co-authored-by: Copilot App <[email protected]>
|
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. |
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 27b89099-1e47-467a-b435-934b230031f3
Local before/after benchmarkNo comparable clean result on my Windows machine using the SDK repo test runner.
Single local run; timings can vary with machine load, but this gives a direct before/after signal on this machine. |
|
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. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Enabling ClassLevel parallelization for Microsoft.NET.Sdk.BlazorWebAssembly.Tests can cause real test-asset directory collisions across classes due to how CreateAspNetSdkTestAsset scopes its destination directory names today.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj — Setting MSTestParallelizeScope=ClassLevel for this assembly is likely unsafe because… |
What changed in this PR
Enables MSTest ClassLevel parallelization for the Blazor WebAssembly and Static Web Assets test projects, while adding [DoNotParallelize] to specific tests/classes that mutate process-global state (notably the current directory) so they won’t race with other tests.
Changes:
- Switch MSTest parallelization scope to
ClassLevelforMicrosoft.NET.Sdk.BlazorWebAssembly.Tests,Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests, andMicrosoft.NET.Sdk.StaticWebAssets.Tests. - Add
[DoNotParallelize]to various Static Web Assets tests (especially*MultiThreadingTestand task-environment tests) that are unsafe under parallel execution. - Update comments explaining why
[DoNotParallelize]is required (ResourceLock cannot protect readers resolving against process CWD).
| File | Description |
|---|---|
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/UpdatePackageStaticWebAssetsMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetTaskEnvironmentTests.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackManifestMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/StaticWebAssetsGeneratePackagePropsFileMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ResolveCompressedAssetsMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ReadStaticWebAssetsManifestFileMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/MergeConfigurationPropertiesMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsPropsFileMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsManifestMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetsDevelopmentManifestMultiThreadingTest.cs | Update comment rationale; keep [DoNotParallelize]. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetEndpointsPropsFileTest.cs | Mark specific test methods [DoNotParallelize] due to process-CWD sensitivity. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/GenerateStaticWebAssetEndpointsManifestMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/FilterStaticWebAssetEndpointsMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/DiscoverPrecompressedAssetsMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/DefineStaticWebAssetsMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ConcatenateCssFilesMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ComputeReferenceStaticWebAssetItemsTest.cs | Mark a specific test method [DoNotParallelize] due to process-CWD sensitivity. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/ComputeEndpointsForReferenceStaticWebAssetsMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssets/CollectStaticWebAssetsToCopyMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/Microsoft.NET.Sdk.StaticWebAssets.Tests.csproj | Switch MSTest parallelization scope to ClassLevel with updated rationale comment. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/ComputeStaticWebAssetsTargetPathsMultiThreadingTest.cs | Add [DoNotParallelize] to avoid parallel execution. |
| test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj | Enable MSTest ClassLevel parallelization. |
| test/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests.csproj | Enable MSTest ClassLevel parallelization. |
Forward caller file paths when copying ASP.NET test assets and serialize compatibility tests that load prior Razor toolchains. Co-authored-by: Copilot App <[email protected]>
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
The publish variant is affected by the same tracked classic Razor regression as the already-quarantined build variant. Co-authored-by: Copilot App <[email protected]>
akoeplinger
left a comment
There was a problem hiding this comment.
LGTM overall, just some questions/nits
Document why current-directory mutators require DoNotParallelize and clarify the class-level parallelization rationale. Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The newly skipped compatibility test references a closed external issue rather than an active SDK tracking issue.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
test/Microsoft.NET.Sdk.StaticWebAssets.Tests/ScopedCssIntegrationTests.cs — This newly skips the test while linking only to an issue that is already closed as completed, so… |
Issues resolved since last review (1)
| Severity | Finding |
|---|---|
test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj — Setting MSTestParallelizeScope=ClassLevel for this assembly is likely unsafe because… View resolved comment |
Reopen the existing SDK issue and use it as the active removal tracker for the publish compatibility quarantine. Co-authored-by: Copilot App <[email protected]>
…-swa-parallel-tests # Conflicts: # test/Microsoft.NET.Sdk.StaticWebAssets.Tests/ScopedCssIntegrationTests.cs
|
/azp run |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. |
Keep the original build compatibility quarantine on its shared Roslyn tracker while the new publish quarantine uses the active SDK removal issue. Co-authored-by: Copilot App <[email protected]>
Keep both scoped CSS compatibility quarantines on the existing Roslyn issue, matching main and reviewer guidance. Co-authored-by: Copilot App <[email protected]>


This is the @dotnet/aspnet-blazor-eng CODEOWNERS split from #56015.
It enables MSTest
ClassLevelparallelization for the Blazor WebAssembly and Static Web Assets test projects, with shared resources and filesystem paths isolated so parallel classes do not collide.10× benchmark results
The combined Razor-fixed branch was measured on the same machine under an exclusive benchmark lock. Each iteration ran the identical 54 affected projects sequentially through
scripts/RunTests.cs, with the same 90-minute per-project timeout and the same exclusion for the pre-existing hanging interruption test.All 10 changed iterations completed with zero timeouts and retained exactly the same 10-project local-environment/prerequisite failure set as all 10 baseline iterations; there were no new or resolved failing projects. These combined-branch measurements provide performance and stability context, not isolated attribution or a per-slice tests-passed claim.
Project medians: Blazor WebAssembly improved from 1,565.421s to 640.283s (59.10%), and Static Web Assets improved from 1,337.848s to 340.583s (74.54%).
CI failure investigation
The first Helix run reported
Build_DefaultDocumentAndSpaFallback_CreatesAdditionalEndpointswith an empty endpoint collection. The failing test used a unique caller/file-hashed asset path, its class remained method-serialized, and its work item contained no current-directory mutators. The downloaded binlog completed successfully and recordedindex.htmlplus the original, default-document, and SPA-fallback routes among 43 generated endpoints.The exact 29-test Helix partition passed 10/10 runs (290/290 tests) under the exclusive benchmark lock. Because the evidence does not support a ClassLevel/shared-state race, no serialization was added. The unrelated
dotnet-new.IntegrationTests.dll.1work item passed 211 tests before its host hung and was killed with exit 137. Empty retry commitd9592144fabae0523cd9f212f3a8b244c7aeee9dstarted replacement CI build 1575664, which succeeded.