Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions eng/pipelines/cdac/prepare-cdac-helix-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# prepare-cdac-helix-steps.yml — Shared steps for preparing cDAC dump test Helix payloads.
#
# Used by CdacDumpTests, CdacXPlatDumpGen, and CdacXPlatDumpTests stages in runtime-diagnostics.yml.
# Handles: building debuggees, preparing Helix payload, finding testhost and Helix queue.

parameters:
buildDebuggees: true
skipDebuggeeCopy: false

steps:
- ${{ if parameters.buildDebuggees }}:
- script: $(Build.SourcesDirectory)$(dir).dotnet$(dir)dotnet$(exeExt) msbuild
$(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj
/t:BuildDebuggeesOnly
/p:Configuration=$(_BuildConfig)
/p:TargetArchitecture=$(archType)
-bl:$(Build.SourcesDirectory)/artifacts/log/BuildDebuggees.binlog
displayName: 'Build Debuggees'

- script: $(Build.SourcesDirectory)$(dir).dotnet$(dir)dotnet$(exeExt) build
$(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj
/p:PrepareHelixPayload=true
/p:SkipDebuggeeCopy=${{ parameters.skipDebuggeeCopy }}
/p:Configuration=$(_BuildConfig)
/p:HelixPayloadDir=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac
/p:SkipDumpVersions=net10.0
-bl:$(Build.SourcesDirectory)/artifacts/log/DumpTestPayload.binlog
displayName: 'Prepare Helix Payload'

- pwsh: |
$testhostDir = Get-ChildItem -Directory -Path "$(Build.SourcesDirectory)/artifacts/bin/testhost/net*-$(osGroup)-*-$(archType)" | Select-Object -First 1 -ExpandProperty FullName
if (-not $testhostDir) {
Write-Error "No testhost directory found matching net*-$(osGroup)-*-$(archType) under artifacts/bin/testhost/"
exit 1
}
Write-Host "TestHost directory: $testhostDir"
Write-Host "##vso[task.setvariable variable=TestHostPayloadDir]$testhostDir"

$queue = switch ("$(osGroup)_$(archType)") {
"windows_x64" { "$(helix_windows_x64)" }
"windows_arm64" { "$(helix_windows_arm64)" }
"linux_x64" { "$(helix_linux_x64_oldest)" }
"linux_arm64" { "$(helix_linux_arm64_oldest)" }
"osx_x64" { "$(helix_macos_x64)" }
"osx_arm64" { "$(helix_macos_arm64)" }
default { Write-Error "Unsupported platform: $(osGroup)_$(archType)"; exit 1 }
}
Write-Host "Helix queue: $queue"
Write-Host "##vso[task.setvariable variable=CdacHelixQueue]$queue"
displayName: 'Find TestHost Directory and Helix Queue'
232 changes: 155 additions & 77 deletions eng/pipelines/runtime-diagnostics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ parameters:
default:
- windows_x64
- linux_x64
# - osx_x64 # Temporarily due to CI capacity constraints. Will re-enable once osx queues are more available.
- windows_arm64
- linux_arm64
# TODO: Re-enable osx once disk space issue is resolved.
# macOS full dumps are ~5.7GB each; with 8+ full-dump debuggees the Helix
# machines run out of disk space (~45GB total). See PR #124782 for details.
# - osx_arm64
# - osx_x64
- name: cdacDumpTestMode
displayName: cDAC Dump Test Mode
type: string
default: single-leg
values:
- single-leg
- xplat

resources:
repositories:
Expand All @@ -23,6 +36,7 @@ resources:

variables:
- template: /eng/pipelines/common/variables.yml
- template: /eng/pipelines/helix-platforms.yml

schedules:
- cron: "30 2 * * *"
Expand Down Expand Up @@ -181,86 +195,150 @@ extends:
condition: failed()

#
# cDAC Dump Creation — Build runtime, create crash dumps, publish dump artifacts
# cDAC Dump Tests — Build, generate dumps, and run tests on Helix (single-leg mode)
#
- stage: DumpCreation
dependsOn: []
jobs:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms: ${{ parameters.cdacDumpPlatforms }}
jobParameters:
buildArgs: -s clr+libs+tools.cdac -c $(_BuildConfig) -rc $(_BuildConfig) -lc $(_BuildConfig)
nameSuffix: CdacDumpGeneration
timeoutInMinutes: 120
postBuildSteps:
- script: $(Build.SourcesDirectory)$(dir).dotnet$(dir)dotnet$(exeExt) msbuild
$(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj
/t:GenerateAllDumps
/p:CIDumpVersionsOnly=true
/p:SetDisableAuxProviderSignatureCheck=true
/p:TargetArchitecture=$(archType)
-bl:$(Build.SourcesDirectory)/artifacts/log/DumpGeneration.binlog
displayName: 'Generate cDAC Dumps'
- template: /eng/pipelines/common/upload-artifact-step.yml
parameters:
rootFolder: $(Build.SourcesDirectory)/artifacts/dumps/cdac
includeRootFolder: false
archiveType: tar
archiveExtension: .tar.gz
tarCompression: gz
artifactName: CdacDumps_$(osGroup)_$(archType)
displayName: cDAC Dump Artifacts
- ${{ if and(eq(parameters.cdacDumpTestMode, 'single-leg'), ne(variables['Build.Reason'], 'Schedule')) }}:
- stage: CdacDumpTests
dependsOn: []
jobs:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms: ${{ parameters.cdacDumpPlatforms }}
shouldContinueOnError: true
jobParameters:
nameSuffix: CdacDumpTest
buildArgs: -s clr+libs+tools.cdac+tools.cdacdumptests -c $(_BuildConfig) -rc $(_BuildConfig) -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0
timeoutInMinutes: 180
postBuildSteps:
- template: /eng/pipelines/cdac/prepare-cdac-helix-steps.yml
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
parameters:
displayName: 'Send cDAC Dump Tests to Helix'
sendParams: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj /t:Test /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) /p:HelixTargetQueues=$(CdacHelixQueue) /p:TestHostPayload=$(TestHostPayloadDir) /p:DumpTestsPayload=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /bl:$(Build.SourcesDirectory)/artifacts/log/SendToHelix.binlog
environment:
_Creator: dotnet-bot
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
NUGET_PACKAGES: $(Build.SourcesDirectory)$(dir).packages
- pwsh: |
if ("$(Agent.JobStatus)" -ne "Succeeded") {
Write-Error "One or more cDAC dump test failures were detected. Failing the job."
exit 1
}
displayName: 'Fail on test errors'
condition: always()

#
# cDAC Dump Tests — Download dumps from all platforms, run tests cross-platform
# cDAC X-Plat Dump Generation and Testing — Two-stage flow:
# 1. Generate dumps on each platform via Helix, download and publish as artifacts
# 2. Download all platforms' dumps and run tests on each target platform
#
- stage: DumpTest
dependsOn:
- DumpCreation
jobs:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms: ${{ parameters.cdacDumpPlatforms }}
jobParameters:
buildArgs: -s tools.cdacdumptests /p:SkipDumpVersions=net10.0
nameSuffix: CdacDumpTests
timeoutInMinutes: 60
postBuildSteps:
# Download and test against dumps from each platform
- ${{ each dumpPlatform in parameters.cdacDumpPlatforms }}:
- template: /eng/pipelines/common/download-artifact-step.yml
- ${{ if or(eq(parameters.cdacDumpTestMode, 'xplat'), eq(variables['Build.Reason'], 'Schedule')) }}:
- stage: CdacXPlatDumpGen
dependsOn: []
jobs:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms: ${{ parameters.cdacDumpPlatforms }}
shouldContinueOnError: true
jobParameters:
nameSuffix: CdacXPlatDumpGen
buildArgs: -s clr+libs+tools.cdac+tools.cdacdumptests -c $(_BuildConfig) -rc $(_BuildConfig) -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0
timeoutInMinutes: 180
postBuildSteps:
- template: /eng/pipelines/cdac/prepare-cdac-helix-steps.yml
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
parameters:
artifactName: CdacDumps_${{ dumpPlatform }}
artifactFileName: CdacDumps_${{ dumpPlatform }}.tar.gz
unpackFolder: $(Build.SourcesDirectory)/artifacts/dumps/${{ dumpPlatform }}
displayName: '${{ dumpPlatform }} Dumps'
- script: $(Build.SourcesDirectory)$(dir).dotnet$(dir)dotnet$(exeExt) test
$(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj
--no-build
--logger "trx;LogFileName=CdacDumpTests_${{ dumpPlatform }}.trx"
--results-directory $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/${{ dumpPlatform }}
displayName: 'Run cDAC Dump Tests (${{ dumpPlatform }} dumps)'
continueOnError: true
env:
CDAC_DUMP_ROOT: $(Build.SourcesDirectory)/artifacts/dumps/${{ dumpPlatform }}
- task: PublishTestResults@2
displayName: 'Publish Results ($(osGroup)-$(archType) → ${{ dumpPlatform }})'
displayName: 'Send cDAC Dump Gen to Helix'
sendParams: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/cdac-dump-helix.proj /t:Test /p:DumpOnly=true /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) /p:HelixTargetQueues=$(CdacHelixQueue) /p:TestHostPayload=$(TestHostPayloadDir) /p:DumpTestsPayload=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /bl:$(Build.SourcesDirectory)/artifacts/log/SendDumpGenToHelix.binlog
environment:
_Creator: dotnet-bot
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
NUGET_PACKAGES: $(Build.SourcesDirectory)$(dir).packages
# After Helix completes and DownloadFilesFromResults runs, publish the dump tar
- pwsh: |
$resultsDir = "$(Build.SourcesDirectory)/artifacts/helixresults"
Write-Host "Helix results directory contents:"
if (Test-Path $resultsDir) {
Get-ChildItem -Recurse $resultsDir | Select-Object -ExpandProperty FullName | ForEach-Object { Write-Host " $_" }
} else {
Write-Host " Directory not found: $resultsDir"
}
displayName: 'List Helix Results'
- task: PublishPipelineArtifact@1
inputs:
testResultsFormat: VSTest
testResultsFiles: '**/*.trx'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/${{ dumpPlatform }}'
testRunTitle: 'cDAC Dump Tests $(osGroup)-$(archType) → ${{ dumpPlatform }}'
failTaskOnFailedTests: true
publishRunAttachments: true
buildConfiguration: $(_BuildConfig)
continueOnError: true
targetPath: $(Build.SourcesDirectory)/artifacts/helixresults
artifactName: CdacDumps_$(osGroup)_$(archType)
displayName: 'Publish Dump Artifacts'
- pwsh: |
if ("$(Agent.JobStatus)" -ne "Succeeded") {
Write-Error "One or more cDAC dump generation failures were detected. Failing the job."
exit 1
}
displayName: 'Fail on dump generation errors'
condition: always()

- stage: CdacXPlatDumpTests
dependsOn:
- CdacXPlatDumpGen
jobs:
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms: ${{ parameters.cdacDumpPlatforms }}
shouldContinueOnError: true
jobParameters:
nameSuffix: CdacXPlatDumpTest
buildArgs: -s clr+libs+tools.cdac+tools.cdacdumptests -c $(_BuildConfig) -rc $(_BuildConfig) -lc $(_BuildConfig) /p:SkipDumpVersions=net10.0
timeoutInMinutes: 180
postBuildSteps:
- template: /eng/pipelines/cdac/prepare-cdac-helix-steps.yml
parameters:
buildDebuggees: false
skipDebuggeeCopy: true
# Download dump artifacts from all source platforms
- ${{ each platform in parameters.cdacDumpPlatforms }}:
- task: DownloadPipelineArtifact@2
inputs:
artifactName: CdacDumps_${{ platform }}
targetPath: $(Build.SourcesDirectory)/artifacts/xplatDumps/${{ platform }}
displayName: 'Download dumps from ${{ platform }}'
# Extract dump tars into the Helix payload
- pwsh: |
$platforms = "${{ join(';', parameters.cdacDumpPlatforms) }}".Split(';')
$payloadDumpsDir = "$(Build.SourcesDirectory)/artifacts/helixPayload/cdac/dumps"
foreach ($platform in $platforms) {
$downloadDir = "$(Build.SourcesDirectory)/artifacts/xplatDumps/$platform"
$tarFile = Get-ChildItem -Recurse -Filter "dumps.tar.gz" -Path $downloadDir | Select-Object -First 1 -ExpandProperty FullName
if (-not $tarFile) {
Write-Error "No dumps.tar.gz found for platform $platform in $downloadDir"
exit 1
}
$destDir = Join-Path $payloadDumpsDir $platform
New-Item -ItemType Directory -Force -Path $destDir | Out-Null
Write-Host "Extracting $tarFile to $destDir"
tar -xzf "$tarFile" -C "$destDir"
}
Write-Host "Dump payload contents:"
Get-ChildItem -Recurse $payloadDumpsDir -Filter "*.dmp" | Select-Object -ExpandProperty FullName | ForEach-Object { Write-Host " $_" }
displayName: 'Extract Dump Artifacts into Payload'
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
parameters:
displayName: 'Send cDAC X-Plat Dump Tests to Helix'
sendParams: $(Build.SourcesDirectory)/src/native/managed/cdac/tests/DumpTests/cdac-dump-xplat-test-helix.proj /t:Test /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) /p:HelixTargetQueues=$(CdacHelixQueue) /p:TestHostPayload=$(TestHostPayloadDir) /p:DumpTestsPayload=$(Build.SourcesDirectory)/artifacts/helixPayload/cdac /bl:$(Build.SourcesDirectory)/artifacts/log/SendXPlatTestToHelix.binlog
environment:
_Creator: dotnet-bot
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
NUGET_PACKAGES: $(Build.SourcesDirectory)$(dir).packages
SourcePlatforms: ${{ join(';', parameters.cdacDumpPlatforms) }}
- pwsh: |
if ("$(Agent.JobStatus)" -ne "Succeeded") {
Write-Error "One or more cDAC x-plat dump test failures were detected. Failing the job."
exit 1
}
displayName: 'Fail on test errors'
condition: always()
# Fail the job if any test or publish step above reported issues.
- script: echo "One or more dump test steps failed." && exit 1
displayName: 'Fail if tests failed'
condition: eq(variables['Agent.JobStatus'], 'SucceededWithIssues')
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DumpTypes>Full</DumpTypes>
<WindowsOnly>true</WindowsOnly>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
<!-- Default dump type for dump generation. Override per-debuggee csproj as needed.
Supported values: "Heap", "Full", or "Heap;Full" for both. -->
<DumpTypes Condition="'$(DumpTypes)' == ''">Heap</DumpTypes>
<!-- Set to true in a debuggee csproj to exclude it from non-Windows platforms. -->
<WindowsOnly Condition="'$(WindowsOnly)' == ''">false</WindowsOnly>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
to extract the DumpTypes property. Returns the project name with DumpTypes metadata. -->
<Target Name="GetDumpTypes" Returns="@(_DumpTypeOutput)">
<ItemGroup>
<_DumpTypeOutput Include="$(MSBuildProjectName)" DumpTypes="$(DumpTypes)" />
<_DumpTypeOutput Include="$(MSBuildProjectName)"
DumpTypes="$(DumpTypes)"
WindowsOnly="$(WindowsOnly)"
ProjectPath="$(MSBuildProjectFullPath)" />
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
ILStub at execution time. SYSLIB1054 warns about preferring LibraryImport. -->
<NoWarn>$(NoWarn);SYSLIB1054</NoWarn>
<DumpTypes>Full</DumpTypes>
<WindowsOnly>true</WindowsOnly>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<!-- This debuggee is intentionally Windows-only (COM interop). -->
<NoWarn>$(NoWarn);CA1416</NoWarn>
<DumpTypes>Full</DumpTypes>
<WindowsOnly>true</WindowsOnly>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
<!-- This debuggee is intentionally Windows-only (COM interop). -->
<NoWarn>$(NoWarn);CA1416</NoWarn>
<DumpTypes>Full</DumpTypes>
<WindowsOnly>true</WindowsOnly>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
a VarargPInvokeStub at execution time. SYSLIB1054 warns about preferring LibraryImport. -->
<NoWarn>$(NoWarn);SYSLIB1054</NoWarn>
<DumpTypes>Full</DumpTypes>
<WindowsOnly>true</WindowsOnly>
</PropertyGroup>
</Project>
Loading
Loading