Repository navigation
Reduce local and Helix test setup overhead - #56016
Merged
Merged
Conversation
|
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: a8f51e3d-8b26-4df0-b2e9-fb2d09921b41
Evangelink
force-pushed
the
dev/amauryleve/test-performance-pr
branch
from
August 31, 2026 07:54
f361c67 to
b3028db
Compare
Evangelink
changed the base branch from
dev/amauryleve/parallel-test-pr
to
main
August 31, 2026 07:56
Evangelink
marked this pull request as ready for review
August 31, 2026 08:11
|
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
🟡 Changes recommended
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.Infrastructure.Tests/PrepareHelixNuGetConfigTests.cs — PrepareHelixNuGetConfigTests uses XDocument/XElement but does not import System.Xml.Linq, which… |
What changed in this PR
This PR reduces fixed overhead in local and Helix test execution by moving per-work-item setup into shared payload preparation, avoiding unnecessary Node installation, and adding a local --repeat mode to re-run tests without rebuilding each time.
Changes:
- Generate a final Helix
NuGet.configonce (via a new MSBuild task) and stop rewriting sources in every work item. - Install Node only for the Static Web Assets shard that contains the TypeScript integration test, and remove an obsolete Windows post-test NuGet cache scan.
- Add
scripts/RunTests.cs --repeat Nand update infra tests/docs to cover and describe the behavior.
| File | Description |
|---|---|
| test/UnitTests.proj | Adjusts shard multipliers, adds Node-only metadata for a specific test class, and generates the Helix NuGet.config once into the payload. |
| test/test-runner/TestRunner.targets | Registers the new PrepareHelixNuGetConfig MSBuild task for use in the test runner targets. |
| test/Microsoft.NET.Infrastructure.Tests/RunTestsScriptTests.cs | Extends runner tests to cover --repeat help text, validation, and repeated execution behavior. |
| test/Microsoft.NET.Infrastructure.Tests/PrepareHelixNuGetConfigTests.cs | Adds a new unit test validating the generated Helix NuGet.config sources. |
| test/Microsoft.NET.Infrastructure.Tests/Microsoft.NET.Infrastructure.Tests.csproj | Adds references needed to test HelixTasks and MSBuild task types. |
| test/HelixTasks/PrepareHelixNuGetConfig.cs | New MSBuild task that edits NuGet.config sources for the Helix environment and adds required local sources. |
| test/HelixTasks/CreateHelixTestWorkItems.cs | Adds per-partition Node installation prefixing based on the partition filter content and new item metadata. |
| scripts/RunTests.cs | Adds --repeat N to build once and run the selected tests multiple times with per-iteration TRX and timings. |
| documentation/project-docs/developer-guide.md | Documents --repeat N behavior for local test runner usage. |
| build/SetupHelixEnvironment.sh | Removes per-item NuGet source rewriting and Node install; ensures Testpackages directory exists. |
| build/SetupHelixEnvironment.cmd | Same as above for Windows work items; ensures Testpackages directory exists. |
| .github/skills/run-tests/SKILL.md | Updates the run-tests skill guidance to mention the single-build + --repeat workflow. |
Evangelink
enabled auto-merge (squash)
August 31, 2026 14:36
Member
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. |
JeremyKuhne
approved these changes
Sep 9, 2026
Evangelink
disabled auto-merge
September 11, 2026 13:34
Evangelink
enabled auto-merge (squash)
September 11, 2026 13:34
auto-merge was automatically disabled
September 11, 2026 13:40
Pull request was closed
|
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. |
Evangelink
had a problem deploying
to
copilot-pat-pool
September 11, 2026 14:15 — with
GitHub Actions
Failure
Evangelink
enabled auto-merge (squash)
September 13, 2026 07:37
Co-authored-by: Copilot App <[email protected]>
JeremyKuhne
approved these changes
Sep 14, 2026
Evangelink
had a problem deploying
to
copilot-pat-pool
September 14, 2026 15:50 — 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 standalone PR addresses fixed test setup costs and over-sharding. The in-process parallelization work formerly tracked in #56015 has been split into owner-aligned PRs.
The change:
NuGet.configonce before work-item creation instead of running a sequence ofdotnet nugetcommands in every item;Microsoft.NET.Sdk.StaticWebAssets.Tests.TypeScriptIntegrationTest;scripts/RunTests.cs --repeat N, which builds once and retains separate per-iteration TRX output and timings.Observations and methodology
I analyzed recent successful
dotnet-sdk-public-cibuilds 1571833 and 1573234, using build 1572757 as the base comparison. The analysis used Helix REST work-item details, console logs, and TRX start/end intervals rather than relying only on top-level Azure DevOps job durations.Across the sampled runs:
The fixed setup floor was approximately 33s Windows and 12s Linux before useful test execution. Every shard ran 18-20 sequential
dotnet nugetprocesses to rewrite the same configuration. Windows also downloaded and extracted Node for every shard even though onlyTypeScriptIntegrationTestuses it. In addition, an obsolete NuGet cache scan dating from 2022 ran after every Windows item.The clearest over-sharding counts were 53 work items for
dotnet.Tests, 24 for NetAnalyzers, 17 for Static Web Assets, and 16 forMicrosoft.NET.Build.Tests. These counts motivated conservative multiplier changes rather than broad repartitioning.macOS agent wait ranged from 0.1m to 66.6m. That is external capacity delay, not test execution overhead, and this PR does not attempt to address it.
Implementation details
PrepareHelixNuGetConfigwrites the final configuration once into the shared payload. It retains only the required original feeds and adds the SDK-under-test and test-package sources using%DOTNET_ROOT%and%DOTNET_SDK_TEST_EXECUTION_DIRECTORY%. NuGet officially uses%NAME%environment-variable expansion in configuration files across platforms, so the generated file is shared by Windows, Linux, and macOS.Node metadata is attached only to the Static Web Assets project, and work-item generation prepends setup only when the partition contains
TypeScriptIntegrationTest. The per-item NuGet CLI rewrite and the obsolete post-test cache scan are removed. Shard multipliers are increased only for the assemblies called out above, preserving multiple workers for the longer integration-test tails.For local investigation,
RunTests.cs --repeat Nperforms the incremental project build once, executes the selected tests N times, retains separate TRX files for each iteration, reports each iteration's timing, and prints aggregate mean/min/max timing. This avoids including repeated build time in flake or performance samples.Completed companion benchmark
The companion in-process parallelization work was measured independently on the same machine under an exclusive lock. This does not attribute those gains to this PR's Helix setup and sharding changes; it supplies the complete before/after evidence that motivated and accompanied this performance work.
All 10 changed iterations completed without timeouts and retained the exact baseline 10-project local-environment/prerequisite failure set. A separate NetAnalyzers 10× run completed with exit code 0 every time: median 364.287s → 121.878s (66.54% faster) and mean 402.691s → 122.301s (69.63% faster).
The local
--repeatimplementation was also covered by focused script tests, and unified build 1575047 succeeded. Nodotnet-sdk-public-ciHelix run was triggered for this PR, so post-change Helix setup/shard effects remain to be measured from a future public CI run and are not inferred from the local benchmark.