Skip to content

Refactor SOS test harness Helix integration - #6019

Merged
max-charlamb merged 18 commits into
dotnet:mainfrom
max-charlamb:sos-helix-refactor
Sep 14, 2026
Merged

max-charlamb merged 18 commits into
dotnet:mainfrom
max-charlamb:sos-helix-refactor

Conversation

@max-charlamb

Copy link
Copy Markdown
Member

Summary

  • move SOS.Tests payload staging into the test project and use a generic Helix dispatcher
  • run one work item per OS, RID, and configuration instead of sharding the test matrix
  • centralize repository, payload, scratch, executable, and upload paths in RepoLayout
  • move SOS-specific submission into dedicated pipeline templates with centralized queue definitions
  • preserve platform preparation for Windows signatures, Unix executable overlays, macOS codesigning, and Alpine restrictions

This is based on and supersedes the implementation approach in #6018.

Validation

  • built SOS.Tests for win-x64 Debug
  • ran 16 focused configuration and payload tests locally
  • staged and validated the Windows Helix payload
  • ran the focused tests from the staged payload using standard Helix environment variables
  • parsed the modified pipeline YAML and validated the generic Helix project configuration

Stage the SOS.Tests payload from the test project, submit one work item per platform through a generic Helix dispatcher, centralize payload paths in RepoLayout, and add dedicated pipeline wiring.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Max Charlamb and others added 2 commits September 10, 2026 16:25
Move SOS.Tests execution to dedicated Helix jobs with a trimmed, disk-backed payload while preserving existing debuggee coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Generate build, test, and SOS Helix display names from job properties so GitHub checks clearly identify each job type.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Max Charlamb added 5 commits September 10, 2026 19:17
Use fixed host-slot pools for dump analysis: two slots each for CDB and LLDB, and one for dotnet-dump. Keep in-process DbgEng capture on its separate exclusive slot.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Use the canonical plist boolean syntax accepted by the macOS codesign entitlement parser.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Recognize the known Linux x64 and arm64 PR_SET_PTRACER race in .NET 8 and 9, and link to the runtime fix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Keep Debug test coverage for pull requests while reserving the duplicate Release test matrix for non-PR builds. Dedicated Release SOS Helix jobs remain enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Run Debug build, test, and SOS Helix jobs for pull requests, and use Release consistently for non-PR validation. Add the matching Windows x86 Debug artifact required by the PR SOS leg.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
@steveisok

Copy link
Copy Markdown
Member

For mac, you may want to consider SOSHARNESS_EXCLUDE_SINGLEFILE_SNAPSHOTS=1. Each of those dumps are about 6GB and wall clock expensive ~1m each.

Max Charlamb and others added 4 commits September 10, 2026 23:49
Stage the matching DAC beside single-file debuggees so Linux and macOS can honor Heap dump requests instead of silently producing Full dumps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Disable LLDB external symbol lookup before opening targets and keep Unix Core object tests on Heap dumps instead of using an unsubstantiated Full-dump workaround.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Use two analyzer slots based on the measured capacity comparison and remove the obsolete idle busy-wait rationale.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Skip the narrow Unix legacy-DAC Heap configurations where dumpobj crashes while probing missing ComWrappers metadata.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
@max-charlamb
max-charlamb marked this pull request as ready for review September 11, 2026 20:15
@max-charlamb
max-charlamb requested a review from a team as a code owner September 11, 2026 20:15
Copilot AI lite review requested due to automatic review settings September 11, 2026 20:15
Copilot stopped reviewing on behalf of max-charlamb due to an error September 11, 2026 20:36

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.

Note

Copilot was unable to run its full agentic suite in this review.

Pull request overview

This PR wires up SOS.Tests for Helix execution by staging a self-contained payload, updating the SOS harness to run from that staged layout, and refining the test matrix/host behavior for improved reliability and determinism across platforms.

Changes:

  • Add Helix payload staging + launch scripts and a generic Helix dispatcher project, and connect SOS.Tests to stage/send to Helix.
  • Update SOS harness layout discovery and tool/runtime resolution to support running from a staged payload root (Helix).
  • Refine dump/session pooling and test-matrix gating (including a targeted dumpobj skip for a known .NET 10 legacy DAC issue) and disable LLDB external symbol lookup.

Reviewed changes

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

Show a summary per file
File Description
src/tests/dirs.proj Stops SOS.Tests from executing in the normal test build while still building it for payload staging.
src/tests/SOSHarnessDebuggees.props Centralizes debuggee catalog + metadata to drive publishing and payload contents.
src/tests/SOS.UnitTests/SOSRunner.cs Disables LLDB external symbol lookup for more deterministic startup.
src/tests/SOS.Tests/TestMatrixCapabilityTests.cs Adds coverage for the new dumpobj capability gating behavior.
src/tests/SOS.Tests/TestMatrices.cs Introduces SupportsDumpObj/skip helper and simplifies core/framework config generation.
src/tests/SOS.Tests/TestConfigValidityTests.cs Expands createdump known-failure coverage + adds tests for new dump-type helpers.
src/tests/SOS.Tests/SosReplayAttribute.cs Moves replay output under a dedicated replay directory and records trace file path via RepoLayout.
src/tests/SOS.Tests/SOS.Tests.csproj Removes official-build skip and imports Helix payload targets.
src/tests/SOS.Tests/README.md Documents Helix behavior, DAC staging for single-file, and LLDB external lookup disablement.
src/tests/SOS.Tests/ObjectInspectionTests.cs Switches to new matrices and adds dumpobj unsupported skip.
src/tests/SOS.Tests/ObjectGcHelperTests.cs Switches to new matrices and adds dumpobj unsupported skip.
src/tests/SOS.Tests/ObjectFieldsTests.cs Switches to new matrices and adds dumpobj unsupported skip.
src/tests/SOS.Tests/HostSlotTests.cs Updates tests for new pooled-slot behavior (two-slot pools).
src/tests/SOS.Tests/HelixPayload.targets Adds MSBuild logic to stage a Helix payload and submit it through the Helix dispatcher.
src/tests/SOS.Tests/Helix/run-sos-tests.sh Adds Linux/macOS Helix work item launcher with LLDB setup and reporting.
src/tests/SOS.Tests/Helix/run-sos-tests.cmd Adds Windows Helix work item launcher with signature-check setup and reporting.
src/tests/SOS.Tests/Helix/debuggee-entitlements.plist Adds macOS entitlements required to run/signal debuggees under Helix.
src/tests/SOS.Tests/DumpSigTests.cs Switches to new matrices and adds dumpobj unsupported skip.
src/tests/SOS.Tests/DumpArrayTests.cs Switches to new matrices and adds dumpobj unsupported skip.
src/tests/SOS.TestHarness/ToolPaths.cs Updates debugger/DAC/tool discovery for staged payloads and Helix runtime layout.
src/tests/SOS.TestHarness/TestConfig.cs Updates single-file dump assumptions and refines dump-kind filtering.
src/tests/SOS.TestHarness/Targets.cs Closes all pooled host slots instead of single instances.
src/tests/SOS.TestHarness/SnapshotStore.cs Adds DAC staging for single-file on Unix, refines dump type mapping, and enforces “use prebuilt on Helix”.
src/tests/SOS.TestHarness/SOS.TestHarness.csproj Embeds configured runtime versions into harness assembly metadata.
src/tests/SOS.TestHarness/RepoLayout.cs Adds staged-payload root discovery, upload/replay/crashdump paths, and Helix dotnet root logic.
src/tests/SOS.TestHarness/LldbHostBase.cs Disables LLDB external lookup and updates trace path plumbing.
src/tests/SOS.TestHarness/HostSlot.cs Introduces HostSlotPool and expands dump-host pooling to bounded concurrency.
src/tests/SOS.TestHarness/HostDiagnostics.cs Moves crash dump directory under RepoLayout upload root.
src/tests/SOS.TestHarness/DumpSession.cs Distributes dump sessions across slot pools (incl. cdb) for bounded concurrency/memory.
src/tests/SOS.TestHarness/DbgEngCapturer.cs Uses the renamed dbgeng capture slot.
src/tests/SOS.TestHarness/CoreVersions.cs Switches to runtime versions embedded from build configuration metadata (no manifest fallback).
src/tests/Debuggees.proj Uses the centralized debuggee catalog + metadata to drive publish lists.
global.json Adds Microsoft.DotNet.Helix.Sdk MSBuild SDK for Helix submission project.
eng/pipelines/sos-helix.yml Adds a job template that builds payload and submits SOS.Tests execution to Helix.
eng/pipelines/helix-platforms.yml Defines Helix queue variables for SOS Helix jobs.
eng/pipelines/build.yml Adjusts display names and dependency wiring for build/test legs.
eng/helix/SendToHelix.proj Adds a generic Helix submission project that enforces single-work-item dispatch and zips payload to disk.
diagnostics.yml Integrates SOS Helix jobs, adds PR-vs-non-PR validation configuration selection, and adjusts build/test leg matrices.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/tests/SOS.TestHarness/SnapshotStore.cs
Comment thread src/tests/SOS.TestHarness/RepoLayout.cs
Comment thread src/tests/SOS.Tests/HelixPayload.targets
@steveisok

Copy link
Copy Markdown
Member

Combining Mac x64 build and arm64 build along with arm64 test into one machine is something to consider. Grabbing any mac off the hosted pool can be a wait fest.

Max Charlamb added 6 commits September 11, 2026 19:59
Disable system core dumps from intentionally crashing debuggees and limit macOS execution to two threads to reduce dump capture pressure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Capture the process table and relevant lsof output when redirected output fails to close on macOS.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Capture process and descriptor state before Linux process-group cleanup so it can be compared with the macOS drain timeout.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
Skip Unix dump tests for .NET 8 and 9 single-file runtimes, whose createdump callback children do not exit. Restore direct process launching now that the unsupported runtime configurations are excluded.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 90d32376-768b-4f8c-a982-54247c372cf3
@max-charlamb
max-charlamb merged commit 4f9d22f into dotnet:main Sep 14, 2026
23 checks passed
@max-charlamb
max-charlamb deleted the sos-helix-refactor branch September 14, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants