AB#12334: Prototype duration-balanced host build tests on Helix - #12479
Draft
mmitche wants to merge 8 commits into
Draft
AB#12334: Prototype duration-balanced host build tests on Helix#12479mmitche wants to merge 8 commits into
mmitche wants to merge 8 commits into
Conversation
Add a guarded public-pipeline path that prepares shared host toolchains and generates configurable duration-balanced Xamarin.Android.Build.Tests work items for Windows and Linux. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document the Azure DevOps task that tracks the guarded host build test prototype. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the NUnit class filter for BuildTest, fail clearly when discovery returns the slicer dummy test, preserve single-test arrays, and report staged payload size. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Let MSBuild copy generated Command and PayloadDirectory metadata when converting private work items to HelixWorkItem entries, while adding the shared timeout. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Split large toolchain trees into correlation payloads capped at 1 GiB, preserve their destinations through generated MSBuild items, and omit the duplicated NuGet cache to avoid the Helix SDK in-memory ZIP limit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep emulator images, skins, and sources out of host-only Helix correlation payloads so large system images are neither uploaded nor downloaded by build-test work items. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Log and persist the largest correlation payload destinations so setup size can be reduced based on measured CI data rather than aggregate bytes alone. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Exclude SDK docs/extras and the Java.Interop checkout, stage only the net10 host test assembly inputs, and add an opt-in host-only iteration mode while preserving full dual execution for parity runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Live validation runs
Name = BuildTestmatched zero tests); Windows validation continues in that run.c41b6aa: build 1563289112d251: build 1563300. The first run showed 1,504 Windows tests packed into 41 fallback work items; submission then failed because the project did not preserve generatedCommandmetadata.911c6b3: build 1563332. Build 1563300 successfully discovered 167 Linux tests in 5 work items, then exposed a 13.57 GiB monolithic payload and the Helix SDK in-memory ZIP limit; payloads are now capped at 1 GiB and the duplicated NuGet cache is omitted.39d7209: build 1563387. Build 1563332 showed that the prepared SDK included a device-only Android 29 x86_64 system image larger than 1 GiB; emulator images, skins, and sources are now excluded from host-only payloads.c6114de: build 1563474, usingskipTests=trueonly to accelerate prototype validation; the final parity run will retain all existing jobs.This run preserves the existing Windows/Linux jobs in the same build for inventory and outcome parity comparison. Results will be recorded here after both the baseline jobs and Helix work items complete.
Azure DevOps tracking - Parent: DNCENG Epic 11483 - Initiative: DNCENG Epic 12333 - Improve dotnet/android P80 PR build time - Implementation task: AB#12334 - Investigate moving dotnet/android tests to Helix ## Summary Prototype moving host-only
Xamarin.Android.Build.Testsfan-out from fixed Azure Pipelines shards to fine-grained Helix work items. This is additive and guarded: the existing Windows and Linux jobs remain unchanged, and the new stage is omitted unlessenableHostBuildTestsHelixPrototypeis enabled. ## Duration-balanced work items - Default target: 15 estimated wall-clock minutes per work item. - Configure withhostBuildTestsHelixTargetMinutes. - Test discovery uses the repository's existingdotnet-test-slicerNUnit support. - Timing data uses the slicer's existingbalance.xmlformat. - Work items use deterministic best-fit-decreasing duration packing. - A test whose duration exceeds the target remains in an isolated work item. - Missing tests use the average of matching historical timings. - With no matching history, generation explicitly reportscount-fallbackand useshostBuildTestsHelixFallbackTestDurationSecondsrather than claiming count slicing is duration-balanced. -hostBuildTestsHelixDurationParallelism(default2.5) translates summed per-test elapsed time to expected work-item wall time while preserving the current NUnit worker behavior. ## Architecture and data flow For each host OS, Azure Pipelines performs setup once and stages a Helix correlation payload containing: - the prepared repository-local .NET SDK and Android workload packs; - Android SDK and JDK; - NuGet and Gradle caches; - test assemblies and required repository test/build inputs; - the existingapkdifftool. Small per-work-item payloads contain only NUnit runsettings, a native Windows/Linux command script, and generation metadata. Work items run on host queues that do not require an Android device: -Windows.Amd64.VS2026.Open-Ubuntu.2404.Amd64.OpenWindows currently covers the full host test assembly. Linux initially covers the existing long, unslicedBuildTestgroup. Each work item runs in its own Helix sandbox and directs temporary/test output to work-item-specific paths. Failures preserve thedotnet testexit code. Uploaded diagnostics include TRX, console output, NUnit/MSBuild test attachments and binlogs, generation metadata, and crash dumps when produced. After completion, successful TRX timings are converted back tobalance.xmland published as OS-specific artifacts. A subsequent run can consume them by settinghostBuildTestsHelixTimingBuildIdto the prior build ID. ## Opt in Queue the public pipeline with: -enableHostBuildTestsHelixPrototype=true-hostBuildTestsHelixTargetMinutes=15- optionallyhostBuildTestsHelixTimingBuildId=<prior build ID>The per-work-item timeout defaults to00:45:00and is configurable throughhostBuildTestsHelixWorkItemTimeout. Example:powershell az pipelines run ` --organization https://dev.azure.com/dnceng-public ` --project public ` --id <dotnet-android-public-definition-id> ` --parameters enableHostBuildTestsHelixPrototype=true hostBuildTestsHelixTargetMinutes=15## Validation - PowerShell generator tests pass, covering deterministic packing, explicit no-history fallback, partial history, oversized tests, zero-duration TRX entries, escaping, generated payloads, and Windows/Linux commands. - Both changed YAML files parse successfully. - The Helix MSBuild project parses, restores, and evaluates successfully with the repository SDK and synthetic work items. - Synthetic end-to-end payload preparation succeeds. - Historical-duration simulation produced: - Windows: 1,910 timed tests into 52 work items, estimated 10.6-15 minutes. - LinuxBuildTest: 239 timed tests into 8 work items, estimated 8.8-15 minutes. -git diff --checkpasses. ## Known limitations / first experiment - No real Helix submission has been run yet; the first opt-in pipeline run should validate queue image prerequisites, correlation payload upload/download size, and actual setup amortization. - The2.5timing parallelism factor is an initial calibration and should be adjusted from observed Helix wall times. - To control correlation payload size, the source copy excludessrc/Mono.Android; tests consume that product through the staged workload packs. The first run should confirm no host test requires additional source-only inputs. - Existing Azure Pipelines jobs intentionally remain enabled during comparison, so the first run duplicates coverage. - Linux initially moves onlyBuildTest; the other Linux smoke groups remain on their existing path.