Skip to content

Integrate Helix Job Monitor into CI and PR pipelines - #54583

Merged
MichaelSimons merged 12 commits into
mainfrom
michaelsimons/helix-job-monitor-integration
Jun 8, 2026
Merged

MichaelSimons merged 12 commits into
mainfrom
michaelsimons/helix-job-monitor-integration

Conversation

@MichaelSimons

@MichaelSimons MichaelSimons commented Jun 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Integrates the Helix Job Monitor from arcade into the SDK's CI and PR pipelines.

The monitor is a dedicated pipeline job that polls Helix for jobs associated with the current build, downloads test result artifacts, and publishes results to Azure DevOps incrementally — allowing the original build agents to stop blocking on Helix execution.

Changes

  • dotnet-tools.json — registers microsoft.dotnet.helix.jobmonitor as a local .NET tool (v11.0.0-beta.26303.111)
  • eng/Version.Details.xml — adds the tool as a toolset dependency sourced from the VMR at the same version/SHA as other arcade toolset dependencies
  • eng/pipelines/templates/jobs/sdk-build.yml — adds /p:EnableHelixJobMonitor=true to both Windows and Linux/macOS Helix test submission steps so agents submit and exit immediately; renames steps from Run Tests to Queue Tests to accurately reflect behavior
  • .vsts-pr.yml — adds the HelixJobMonitor job (uses arcade template default 360-min timeout, public queues)
  • .vsts-ci.yml — adds the HelixJobMonitor job (uses arcade template default 360-min timeout, internal, with HelixApiAccessToken, gated on the same condition as other test-build jobs)
  • test/UnitTests.proj — reduces XUnitWorkItemTimeout from 2 hours to 1 hour. Analysis of recent CI runs shows the longest work item execution is ~33 minutes (BlazorWebAssembly.Tests.dll on Windows FullFramework); 60 minutes provides ~1.8x headroom while reducing wasted Helix machine time for genuinely hung test processes.

Behavior notes

  • Build agent jobs will complete as soon as Helix work is submitted (green = queued successfully, not tests passed)
  • The HelixJobMonitor pipeline job is where pass/fail is determined and test results are published
  • Rerun optimization: When you rerun the Monitor Helix Jobs pipeline job, it only re-queues the failed tests — not the entire test suite. This is a significant improvement for rerun scenarios where only a few tests failed (e.g., flaky tests or transient infrastructure issues).
  • The existing PublishTestResults step is unaffected — it is already gated on publishXunitResults: true which is only set for the non-Helix TestTemplatesCG local test job
  • The monitor timeout uses the arcade template default of 360 minutes (with --max-wait-minutes set 5 minutes lower internally for graceful shutdown). If the timeout is reached, the tool cancels in-flight Helix jobs via the API before exiting. There is no pipeline-level timeout in the YAML that would preempt this; each job is governed by its own timeoutInMinutes.

- Register microsoft.dotnet.helix.jobmonitor as a local .NET tool in
  dotnet-tools.json (v11.0.0-beta.26277.111)
- Add toolset dependency in eng/Version.Details.xml sourced from the VMR
  at the same version and SHA as other arcade toolset dependencies
- Add /p:EnableHelixJobMonitor=true to Helix test submission steps so
  build agents submit jobs and exit immediately instead of blocking
- Rename test steps from 'Run Tests' to 'Queue Tests' to accurately
  reflect that the step only submits work; results are published by the
  monitor job
- Add HelixJobMonitor job to .vsts-pr.yml (public, 120-min timeout)
- Add HelixJobMonitor job to .vsts-ci.yml (internal, with HelixApiAccessToken,
  gated on the same condition as other test-build jobs)

Co-authored-by: Copilot <[email protected]>
MichaelSimons and others added 7 commits June 3, 2026 15:36
- Remove category name substitution from Queue Tests display name
- Remove redundant condition: succeeded() from both Queue Tests steps
- Bump Microsoft.DotNet.Arcade.Sdk and Microsoft.DotNet.Helix.Sdk in
  global.json from 26261.101 to 26277.111 to match Version.Details.xml
  and enable EnableHelixJobMonitor support

Co-authored-by: Copilot <[email protected]>
Remove the explicit 120-minute timeout override from both PR and CI
pipelines so the arcade template default of 360 minutes is used.
The previous value was too short for the full pipeline to complete
and publish all test results.

Also update the Helix Job Monitor tool to 11.0.0-beta.26303.111
to pick up bug fixes.

Co-authored-by: Copilot <[email protected]>
The longest observed work item across recent CI runs is ~33 minutes
(BlazorWebAssembly.Tests.dll.1 on Windows FullFramework). A 60-minute
timeout provides ~1.8x headroom while reducing wasted Helix machine
time for genuinely hung test processes.

Co-authored-by: Copilot <[email protected]>
The build step already restores all test projects via sdk.slnx, so the
test queuing step's -restore flag was causing a redundant sequential
NuGet restore of 200+ test projects. The Helix SDK is resolved via
global.json (no NuGet restore needed), and RID-specific restores are
already handled inside BuildSDKCustomXUnitProjects unconditionally.

This eliminates:
- Sequential evaluation/restore of 200+ already-restored test projects
- Redundant shared framework installs from eng/restore-toolset.ps1
- Redundant native tools initialization

Co-authored-by: Copilot <[email protected]>
CleanOutStage0ToolsetsAndRuntimes uses DOTNET_INSTALL_DIR which is
only initialized when InitializeDotNetCli runs during restore. When
-restore is not passed (e.g., the Queue Tests step which only runs
-test), the variable is unbound and build.sh's 'set -u' causes a
failure. Guard the call with the same restore check used by
InitializeCustomSDKToolset.

Co-authored-by: Copilot <[email protected]>
Comment thread .vsts-ci.yml Resolved
MichaelSimons and others added 2 commits June 5, 2026 11:35
Places the Monitor Helix Jobs job first in the pipeline so it appears
at a predictable position in the AzDO UI — making it easy to check
test progress and failures as they come in.

Co-authored-by: Copilot <[email protected]>
@MichaelSimons
MichaelSimons marked this pull request as ready for review June 5, 2026 16:36
@MichaelSimons
MichaelSimons requested a review from MiYanni as a code owner June 5, 2026 16:36
Copilot AI review requested due to automatic review settings June 5, 2026 16:36
@MichaelSimons
MichaelSimons requested a review from mmitche June 5, 2026 16:37

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.

Pull request overview

This PR integrates the Arcade Helix Job Monitor into the SDK’s Azure DevOps PR/CI pipelines so build agents can submit Helix work and finish early, while a dedicated monitor job waits for Helix completion and publishes test results incrementally.

Changes:

  • Adds a Helix Job Monitor job to both PR and CI pipelines and enables “submit-and-exit” behavior for Helix test submission.
  • Updates Arcade/Helix SDK versions and adds the job monitor tool as a tracked toolset dependency.
  • Reduces Helix xUnit work item timeout from 2 hours to 1 hour.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/UnitTests.proj Reduces XUnitWorkItemTimeout to limit wasted Helix time on hung work items.
global.json Bumps Arcade/Helix MSBuild SDK versions needed for Helix Job Monitor support.
eng/Version.Details.xml Tracks the Helix Job Monitor tool as a toolset dependency (VMR-sourced).
eng/pipelines/templates/jobs/sdk-build.yml Passes /p:EnableHelixJobMonitor=true so Helix submission queues work and exits immediately; renames steps accordingly.
dotnet-tools.json Registers the Helix Job Monitor as a local tool for restore/run in the monitor job.
.vsts-pr.yml Adds the Helix Job Monitor job to the public PR pipeline.
.vsts-ci.yml Adds the Helix Job Monitor job to the internal CI pipeline (with token).

Comment thread dotnet-tools.json Resolved
Comment thread eng/Version.Details.xml Resolved
Picks up dotnet/arcade#16936 which fixes the HelixPostCommands script
that gathers test result files (.trx) into HELIX_WORKITEM_UPLOAD_ROOT.
The old version used 'read -r -d' (bash-only) which fails with
'Illegal option -d' on POSIX /bin/sh, preventing test results from
being uploaded and published by the monitor.

Co-authored-by: Copilot <[email protected]>
@MichaelSimons

Copy link
Copy Markdown
Member Author

FYI I needed to push one last update to get a new Microsoft.DotNet.Helix.Sdk version in order to pickup dotnet/arcade#16936.

@MichaelSimons

Copy link
Copy Markdown
Member Author

/ba-g all test failures appear related to #54608

@MichaelSimons
MichaelSimons merged commit 6dd753f into main Jun 8, 2026
23 of 25 checks passed
@MichaelSimons
MichaelSimons deleted the michaelsimons/helix-job-monitor-integration branch June 8, 2026 13:12
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