Consolidate Helix shards for quick test assemblies via MethodLimitMultiplier#54115
Draft
MichaelSimons wants to merge 4 commits intodotnet:mainfrom
Draft
Consolidate Helix shards for quick test assemblies via MethodLimitMultiplier#54115MichaelSimons wants to merge 4 commits intodotnet:mainfrom
MichaelSimons wants to merge 4 commits intodotnet:mainfrom
Conversation
…tiplier
Add per-assembly MethodLimitMultiplier metadata support to reduce wasted
Helix compute on assemblies whose shards all complete very quickly. The
multiplier increases the methods-per-shard threshold, producing fewer but
larger work items and reducing per-item setup overhead.
Applied to three assembly groups:
- Microsoft.CodeAnalysis.NetAnalyzers (x5)
- Microsoft.TemplateEngine.* / TemplateSearch.* (x10)
- Microsoft.DotNet.Api{Compatibility,Diff,SymbolExtensions} (x5)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TE assemblies are already single-shard on FullFramework at x10. The x20 bump collapses the remaining 2-shard assemblies on TestBuild legs (Cli.UnitTests, Core.UnitTests, Orchestrator) to single shards. Api group bumped to x10 and expanded to include GenAPI.Tests and PackageValidation.Tests for additional shard savings. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bbc8430 to
db5ebf7
Compare
This was referenced Apr 28, 2026
Open
This was referenced Apr 29, 2026
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
Adds a
MethodLimitMultipliermetadata option forSDKCustomXUnitProjectitems to consolidate Helix test shards for assemblies that produce many very short work items. This reduces per-item overhead (payload download, setup, teardown) and makes us better citizens of the shared Helix queues.How it works
AssemblySchedulerpartitions each test assembly into shards based on amethodLimitthreshold (default 16, or 32 for FullFramework).MethodLimitMultipliersimply multiplies that threshold, producing fewer, larger shards. It is set via MSBuild item metadata inUnitTests.proj— no new config files.Changes
SDKCustomCreateXUnitWorkItemsWithTestExclusion.cs— Reads optionalMethodLimitMultipliermetadata; warns on invalid valuesUnitTests.proj— Applies multipliers to three assembly groups:Results
Linux x64
Windows x64
macOS x64
FullFramework Windows
Overall
¹ TemplateEngine and Api assemblies are now at one shard per assembly — the minimum possible without cross-assembly consolidation. Further shard reduction for these groups would require changes to the Helix sharding model itself.