Repository navigation
Parallelize NetAnalyzers unit tests - #56028
Merged
Merged
Conversation
Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Review tier: Lite
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
src/Microsoft.CodeAnalysis.NetAnalyzers/tests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests.csproj — The justification comment hard-codes a Windows-only temp path ("%TEMP%\test-packages") and asserts… |
|
src/Microsoft.CodeAnalysis.NetAnalyzers/AGENTS.md — AGENTS.md says "the unit-test assembly" uses method-level parallelization, but this doc applies to… |
What changed in this PR
Enables MSTest method-level parallelization for the NetAnalyzers unit-test assembly (overriding the repo-wide default that disables parallel execution) and updates area guidance to reflect the new concurrency requirement.
Changes:
- Set
MSTestParallelizeScopetoMethodLevelforMicrosoft.CodeAnalysis.NetAnalyzers.UnitTests. - Document the method-level parallelization expectation in
src/Microsoft.CodeAnalysis.NetAnalyzers/AGENTS.md.
| File | Description |
|---|---|
| src/Microsoft.CodeAnalysis.NetAnalyzers/tests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests/Microsoft.CodeAnalysis.NetAnalyzers.UnitTests.csproj | Opts the NetAnalyzers unit-test project into method-level MSTest parallelization via MSTestParallelizeScope. |
| src/Microsoft.CodeAnalysis.NetAnalyzers/AGENTS.md | Notes that the unit-test assembly runs with method-level parallelization and that new additions must remain concurrency-safe. |
Evangelink
enabled auto-merge (squash)
September 1, 2026 08:11
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 4a0fad96-150a-46b2-a506-ea3a47fc0c1b
tannergooding
approved these changes
Sep 1, 2026
Evangelink
had a problem deploying
to
copilot-pat-pool
September 1, 2026 14:14 — with
GitHub Actions
Failure
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This is the independent
net-analyzersreplacement slice of #56015.MethodLevelparallelization for the NetAnalyzers unit-test assembly.src/Microsoft.CodeAnalysis.NetAnalyzers/AGENTS.mdguidance.Ownership
@dotnet/dotnet-analyzers owns this NetAnalyzers test area, with agent and contributor guidance maintained in
src/Microsoft.CodeAnalysis.NetAnalyzers/AGENTS.md.Isolation rationale
Each test creates a self-contained Roslyn compilation through a fresh verifier instance. The assembly has no assembly-, class-, or test-initialization fixtures, and its shared state is limited to init-once immutable metadata references and dynamic-data providers.
ReferenceAssemblies.ResolveAsyncprotects the shared package cache with its cross-process semaphore.The added AGENTS guidance requires future fixtures, data sources, process-global state, and filesystem paths to remain safe for concurrent test methods.
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.
A separate 10-run NetAnalyzers measurement completed with exit code 0 on every run and no failures or timeouts.
Raw baseline seconds:
760.757, 370.872, 367.239, 370.873, 356.237, 360.802, 362.482, 356.704, 366.091, 354.850.Raw changed seconds:
138.448, 125.842, 126.657, 124.467, 123.759, 117.878, 116.751, 114.518, 114.689, 119.998.