Use helix job monitor - #84810
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 250706b2-8fc3-4688-aabf-7de5304b4b5c
Let cancellation propagate, retain submitted Helix job IDs in logs, and remove documentation changes from this feature. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 250706b2-8fc3-4688-aabf-7de5304b4b5c
Resolve the Arcade dependency conflict by aligning the Helix job monitor with Arcade 11.0.0-beta.26407.6. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 250706b2-8fc3-4688-aabf-7de5304b4b5c
|
Azure Pipelines: Successfully started running 2 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
This PR updates Roslyn’s Helix test submission and Azure Pipelines configuration to rely on the Arcade Helix Job Monitor for external monitoring/reporting, replacing the in-tool Helix polling/cancellation logic previously implemented in RunTests.
Changes:
- Update RunTests’ Helix submission project to enable Helix Job Monitor and simplify Helix submission flow.
- Wire Azure Pipelines to add Helix job monitor jobs and add the Helix job monitor tool/dependency versions.
- Remove the in-repo
HelixApipolling implementation used for Helix job monitoring.
Show a summary per file
| File | Description |
|---|---|
| src/Tools/RunTests/Options.cs | Updates Helix option help text to reflect external job monitor usage. |
| src/Tools/RunTests/HelixTestRunner.cs | Removes Helix API polling/cancellation logic; enables Helix job monitor in generated Helix project; simplifies submission execution path. |
| src/Tools/RunTests/HelixApi.cs | Removes the custom Helix REST API helper and related response models. |
| eng/Version.Details.xml | Adds Microsoft.DotNet.Helix.JobMonitor toolset dependency entry. |
| eng/Version.Details.props | Adds properties for Helix Job Monitor package/version. |
| eng/pipelines/test-windows-job.yml | Removes explicit SYSTEM_ACCESSTOKEN export from the test submission step. |
| eng/pipelines/test-unix-job.yml | Removes explicit SYSTEM_ACCESSTOKEN export from the test submission step. |
| eng/common/dotnet.sh | Adds a dotnet bootstrapper used by the job monitor template to restore/run tools. |
| dotnet-tools.json | Adds a dotnet tool entry for the Helix Job Monitor. |
| azure-pipelines.yml | Adds pool provider variables template, renames/reshapes Windows test stages, and adds Helix Job Monitor jobs to stages. |
Review details
Suppressed comments (2)
azure-pipelines.yml:347
- Same issue here: without
dependsOn/condition, the Helix job monitor can start before Helix submissions complete or get skipped if a test job fails. It should depend on the Helix test jobs in this stage and run undersucceededOrFailed()so results are still reported when tests fail.
- template: /eng/common/core-templates/job/helix-job-monitor.yml
parameters:
helixAccessToken: $(HelixApiAccessToken)
azure-pipelines.yml:395
- The Helix job monitor job should depend on the Helix submission job(s) in this stage; otherwise it can start before any Helix jobs exist and fail early. Also set
condition: succeededOrFailed()so the monitor still publishes results when the test job fails.
- template: /eng/common/core-templates/job/helix-job-monitor.yml
parameters:
helixAccessToken: $(HelixApiAccessToken)
- Files reviewed: 9/10 changed files
- Comments generated: 5
- Review effort level: Lite
RunTests still uses SYSTEM_ACCESSTOKEN to query Azure DevOps test history before submitting Helix work. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 250706b2-8fc3-4688-aabf-7de5304b4b5c
There was a problem hiding this comment.
Review details
Suppressed comments (1)
dotnet-tools.json:16
- The new local tool entry doesn’t specify
rollForward: falselike the existingpowershelltool entry. If the intent is to keep tool execution deterministic across agents (especially for CI), this tool should follow the same setting.
"microsoft.dotnet.helix.jobmonitor": {
"version": "11.0.0-beta.26407.8",
"commands": [
"dotnet-helix-job-monitor"
]
}
- Files reviewed: 9/10 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
Review details
Suppressed comments (2)
src/Tools/RunTests/HelixTestRunner.cs:85
Processreturned byStartHelixJobis no longer disposed. This can leak OS handles/pipes for stdout/stderr redirection during long CI runs. Wrap the process in ausingdeclaration (or dispose it in thefinally).
var helixProjectFilePath = await CreateHelixArtifactsAsync(options, assemblies, cts.Token).ConfigureAwait(false);
var process = StartHelixJob(options, helixProjectFilePath);
try
{
await process.WaitForExitAsync(cts.Token);
return process.ExitCode;
}
eng/Version.Details.xml:159
- The new
Microsoft.DotNet.Helix.JobMonitordependency uses a different Arcade SHA than the other Arcade toolset dependencies at the same version (11.0.0-beta.26407.8). This inconsistency can break dependency flow/update tooling because the SHA is expected to correspond to the commit that produced that version.
<Dependency Name="Microsoft.DotNet.Helix.JobMonitor" Version="11.0.0-beta.26407.8">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>41232a67a0c1a77d425a6bef59ded8a81a2fdf3c</Sha>
</Dependency>
- Files reviewed: 9/10 changed files
- Comments generated: 0 new
- Review effort level: Lite
| helixApiAccessToken: $(HelixApiAccessToken) | ||
| poolParameters: ${{ parameters.windowsPool }} | ||
|
|
||
| - template: /eng/common/core-templates/job/helix-job-monitor.yml |
There was a problem hiding this comment.
So we must have one monitor leg per one stage?
There was a problem hiding this comment.
This will continue to offer us the ability to initiate a retry earlier for shorter stages. Retries are performed by rerunning the monitor job which then retries only the failed work items. David did combine some small stages where it made sense.
There was a problem hiding this comment.
Makes sense but I think the main motivation for the monitor job is to save CI resources, so one job would do that better. I guess it's a tradeoff. (Also the monitor job only retries the actually failed work item so it will already be so much faster to retry failed jobs than what we have now.)
There was a problem hiding this comment.
Yeah - and the arcade implementation requires a monitor per stage. So I merged a few stages where it made sense. We now have just two windows stages (tied to the build debug or release)
|
cc @jaredpar |
|
|
||
| if (workItems.Waiting > 0 && elapsed > TimeSpan.FromMinutes(20)) | ||
| { | ||
| ConsoleUtil.Warning($"Helix job {helixJobId} has {details.WorkItems.Waiting} queued work items after {elapsed:hh\\:mm}. This indicates a queue backup"); |
There was a problem hiding this comment.
The job monitor itself does log info regularly. Example snippet:
2026-08-10T21:53:47.2130985Z info: ℹ️ Status: 1 processed / 2 completed / 3 running / 0 waiting jobs
2026-08-10T21:53:47.2131389Z 32 processed / 42 completed / 33 running / 0 waiting work items
2026-08-10T21:53:47.9756396Z info: 0 test results for job 'Test_Windows_CoreClr_IOperation_Debug - windows.10.amd64.open (7838176b-9a1d-43c9-a043-94294c12bcd9)' processed.
2026-08-10T21:55:19.3488874Z info: Job Test_Windows_CoreClr_RuntimeAsync_Debug - windows.10.amd64.open (29ff0112-b7a9-4b46-9408-e33c602df27f) completed. Processing test results...
2026-08-10T21:55:19.3489484Z https://helix.dot.net/api/2019-06-17/jobs/29ff0112-b7a9-4b46-9408-e33c602df27f/details
2026-08-10T21:55:19.3497562Z info: ✅ Job 'Test_Windows_CoreClr_RuntimeAsync_Debug - windows.10.amd64.open (29ff0112-b7a9-4b46-9408-e33c602df27f)' succeeded (5 passed, 0 failed)
2026-08-10T21:55:19.3498296Z https://helix.dot.net/api/2019-06-17/jobs/29ff0112-b7a9-4b46-9408-e33c602df27f/details
2026-08-10T21:55:19.8863112Z info: ℹ️ Status: 2 processed / 3 completed / 2 running / 0 waiting jobs
2026-08-10T21:55:19.8863638Z 42 processed / 47 completed / 28 running / 0 waiting work items
However we lose the synthetic test results - we could consider augmenting the helix monitor with that capability
Print a green message after successful submission directing users to the stage monitor for status and automatic retries. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 250706b2-8fc3-4688-aabf-7de5304b4b5c
There was a problem hiding this comment.
Review details
Suppressed comments (1)
src/Tools/RunTests/HelixTestRunner.cs:80
ProcessimplementsIDisposableand should be disposed to avoid leaking OS handles in longer-running invocations. Since this method now only waits for submission to exit, using ausing varis a simple way to ensure cleanup.
var helixProjectFilePath = await CreateHelixArtifactsAsync(options, assemblies, cts.Token).ConfigureAwait(false);
var process = StartHelixJob(options, helixProjectFilePath);
try
- Files reviewed: 9/10 changed files
- Comments generated: 0 new
- Review effort level: Lite
2573521 to
e6f7116
Compare
## Summary - backport the Roslyn `RunTests` changes needed for the standalone Helix Job Monitor - consolidate Windows Helix submissions and add monitor jobs for Windows, Linux, and macOS - pin the monitor tool to the Arcade `release/10.0` build used by #85150 This PR is stacked on #85150 so the diff contains only the test runner and CI infrastructure changes. After #85150 merges, this PR can be retargeted to `release/dev18.0`. Backports the relevant behavior from #84810, #84872, #84873, and #85070. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/roslyn/pull/85153) --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4f9174b1-67dc-4def-b0c1-3b8e1746e681
Implements the helix job monitor from arcade.
Since the monitor runs per stage, I combined some of the stages so that we only have two monitor jobs (corresponding to each build artifacts type). This should not negatively impact retries since the job monitor retries individual work items internally.
Note - we do lose some of the custom monitoring:
Microsoft Reviewers: Open in CodeFlow