Skip to content

Parallelize compatibility tool tests - #56030

Merged
Evangelink merged 2 commits into
dotnet:mainfrom
Evangelink:dev/amauryleve/compatibility-parallel-tests
Sep 9, 2026
Merged

Evangelink merged 2 commits into
dotnet:mainfrom
Evangelink:dev/amauryleve/compatibility-parallel-tests

Conversation

@Evangelink

@Evangelink Evangelink commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

Summary

This is the independent replacement for the compatibility partition of #56015, split according to the @dotnet/area-infrastructure-libraries CODEOWNERS boundary.

  • Enable MSTest assembly parallelization for the ApiCompat, PackageValidation, ApiDiff, GenAPI, and ApiSymbolExtensions test projects.
  • Keep the stderr-sensitive ValidatePackageInProcessTests PackageValidation class in MSTest's serial tail because each method runs pack/restore child processes and asserts on stderr, which can include concurrent shared-cache diagnostics.

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.

Fleet statistic Baseline Changed Improvement
Mean 14,773.837s 7,341.516s 50.31%
Median 14,276.260s 6,742.966s 52.77%
Min 14,193.833s 5,426.805s —
Max 18,277.595s 10,443.242s —

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.

Representative project medians: PackageValidation improved 66.63%, GenAPI integration improved 29.62%, GenAPI unit tests improved 19.19%, and ApiDiff improved 11.18%; ApiCompat and ApiSymbolExtensions, both short-running projects, regressed by 1.892s and 7.701s respectively.

@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.

@Evangelink
Evangelink marked this pull request as ready for review August 31, 2026 17:01
@Evangelink
Evangelink requested a review from a team as a code owner August 31, 2026 17:01
Copilot AI lite review requested due to automatic review settings August 31, 2026 17:01
@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

🟡 Changes recommended

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity test/​Compatibility/​ApiCompat/​Microsoft.DotNet.PackageValidation.Tests/​ValidatePackageInProcessTests.cs — The rationale for marking this test non-parallelizable (pack/restore stderr noise under concurrent…
What changed in this PR

This PR opts specific Compatibility tool test projects into MSTest assembly parallelization to reduce overall test wall-clock time, while attempting to keep a known stderr-sensitive PackageValidation scenario from running concurrently.

Changes:

  • Enable MSTest assembly parallelization in several Compatibility test projects via MSTestParallelizeScope (mostly MethodLevel, one ClassLevel).
  • Mark ValidateReferencesAreRespectedForPlatformSpecificTFMs as [DoNotParallelize] to avoid concurrency-related stderr noise during pack/restore.
File Description
test/​Compatibility/​Microsoft.DotNet.ApiSymbolExtensions.Tests/​Microsoft.DotNet.ApiSymbolExtensions.Tests.csproj Opts this test assembly into MSTest parallel execution (ClassLevel).
test/​Compatibility/​GenAPI/​Microsoft.DotNet.GenAPI.Tests/​Microsoft.DotNet.GenAPI.Tests.csproj Opts this test assembly into MSTest parallel execution (MethodLevel).
test/​Compatibility/​GenAPI/​Microsoft.DotNet.GenAPI.IntegrationTests/​Microsoft.DotNet.GenAPI.IntegrationTests.csproj Opts this test assembly into MSTest parallel execution (MethodLevel).
test/​Compatibility/​ApiDiff/​Microsoft.DotNet.ApiDiff.IntegrationTests/​Microsoft.DotNet.ApiDiff.IntegrationTests.csproj Opts this test assembly into MSTest parallel execution (MethodLevel).
test/​Compatibility/​ApiCompat/​Microsoft.DotNet.PackageValidation.Tests/​Microsoft.DotNet.PackageValidation.Tests.csproj Opts this test assembly into MSTest parallel execution (MethodLevel).
test/​Compatibility/​ApiCompat/​Microsoft.DotNet.ApiCompat.Tests/​Microsoft.DotNet.ApiCompat.Tests.csproj Opts this test assembly into MSTest parallel execution (MethodLevel).
test/​Compatibility/​ApiCompat/​Microsoft.DotNet.PackageValidation.Tests/​ValidatePackageInProcessTests.cs Adds [DoNotParallelize] to one pack/restore test to reduce stderr-related flakiness under concurrency.

@Evangelink

Copy link
Copy Markdown
Member Author

Local before/after benchmark

Partial local gain confirmed on my Windows machine using the SDK repo test runner.

  • Machine: Microsoft Windows 11 Enterprise, AMD RYZEN AI MAX+ 395 w/ Radeon 8060S , 32 logical processors
  • Baseline: origin/main (890dd7f)
  • PR head: dev/amauryleve/compatibility-parallel-tests (0837a67)
  • Command shape: .\.dotnet\dotnet.exe scripts\RunTests.cs -- --project <project>
  • Reported numbers use the test run duration from the runner output; build/setup wall-clock is excluded.

Comparable clean total: 1m 23.1s before -> 36.641s after (46.489s saved, 55.9%).

Project Before After Delta Result
Microsoft.DotNet.ApiCompat.Tests 0.192s 0.333s -0.141s passed; slower in this run
Microsoft.DotNet.PackageValidation.Tests 57.21s 18.545s 38.665s passed
Microsoft.DotNet.ApiDiff.IntegrationTests 12.123s 7.139s 4.984s passed
Microsoft.DotNet.GenAPI.IntegrationTests failed failed n/a base/head failed: Microsoft.DotNet.GenAPI.Task package unavailable locally
Microsoft.DotNet.GenAPI.Tests 6.455s 3.428s 3.027s passed
Microsoft.DotNet.ApiSymbolExtensions.Tests 7.15s 7.196s -0.046s passed; slower in this run

Single local run; timings can vary with machine load, but this gives a direct before/after signal on this machine.

@Evangelink
Evangelink enabled auto-merge (squash) September 8, 2026 15:46
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: ba1785fb-ec67-45f3-8e5c-bfe27ae59b22
@Evangelink
Evangelink merged commit 03a7330 into dotnet:main Sep 9, 2026
29 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 10, 2026

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — c70cb835 Deployed Sep 9, 2026 by Evangelink via pre_activation #3608
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants