[cDAC] Publish cDAC stress test logs as an ADO pipeline artifact#129759
Closed
max-charlamb wants to merge 1 commit into
Closed
[cDAC] Publish cDAC stress test logs as an ADO pipeline artifact#129759max-charlamb wants to merge 1 commit into
max-charlamb wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves diagnosability of cDAC GC stress runs by making the rich per-debuggee verification logs visible in Azure DevOps: logs are written into a dedicated Helix upload subdirectory, archived into a single tarball for DownloadFilesFromResults, and then published as an ADO pipeline artifact.
Changes:
- Write stress verification logs to
$(HELIX_WORKITEM_UPLOAD_ROOT)/cdac-stress-logs(or local temp fallback) and ensure the directory exists. - Update the Helix work item command to run xUnit, tar the log directory into
cdac-stress-logs.tar.gz, and download that tarball from Helix results. - Publish
artifacts/helixresultsas a pipeline artifact in theCdacStressTestleg withcondition: always().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/native/managed/cdac/tests/StressTests/CdacStressTestBase.cs | Routes stress logs into a dedicated cdac-stress-logs directory and creates it up front. |
| src/native/managed/cdac/tests/StressTests/cdac-stress-helix.proj | Switches to a command-file-style work item command, archives logs into a known tarball name, and declares it for DownloadFilesFromResults. |
| eng/pipelines/runtime-diagnostics.yml | Publishes artifacts/helixresults as an ADO pipeline artifact for the stress leg on all outcomes. |
Comment on lines
+44
to
+46
| string logRoot = Environment.GetEnvironmentVariable("HELIX_WORKITEM_UPLOAD_ROOT") | ||
| ?? Path.GetTempPath(); | ||
| string logDir = Path.Combine(logRoot, "cdac-stress-logs"); |
Comment on lines
+62
to
+65
| The command is built as a list of lines written to a command file (following | ||
| cdac-dump-helix.proj). xUnit runs first; its exit code is captured before the | ||
| archive step (which always succeeds) and re-applied afterwards so a tar failure | ||
| can't mask — or fabricate — a test failure. |
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
This was referenced Jun 23, 2026
Comment on lines
+91
to
+100
| function Add-Attachment([string]$uri, [string]$fileName, [string]$filePath) { | ||
| $bytes = [System.IO.File]::ReadAllBytes($filePath) | ||
| $body = @{ | ||
| stream = [System.Convert]::ToBase64String($bytes) | ||
| fileName = $fileName | ||
| attachmentType = 'GeneralAttachment' | ||
| comment = 'cDAC GC stress verification log' | ||
| } | ConvertTo-Json | ||
| Invoke-RestMethod -Headers ($headers + @{ 'Content-Type' = 'application/json' }) -Uri $uri -Method Post -Body $body | Out-Null | ||
| } |
Comment on lines
+48
to
+50
| function Write-Info($msg) { Write-Host "[attach-cdac-stress-logs] $msg" } | ||
| function Write-Warn($msg) { Write-Host "##[warning][attach-cdac-stress-logs] $msg" } | ||
|
|
Comment on lines
+286
to
+292
| & $(Build.SourcesDirectory)/eng/pipelines/cdac/attach-cdac-stress-logs.ps1 ` | ||
| -CollectionUri "$(System.CollectionUri)" ` | ||
| -TeamProject "$(System.TeamProject)" ` | ||
| -BuildId "$(Build.BuildId)" ` | ||
| -AccessToken "$(System.AccessToken)" ` | ||
| -RunNamePrefix "cDAC Stress $(osGroup) $(archType) - " ` | ||
| -HelixResultsDir "$(Build.SourcesDirectory)/artifacts/helixresults" |
Comment on lines
66
to
69
| Testhost layout: dotnet.exe at the root, CoreCLR + corerun + mscordaccore_universal | ||
| under shared/Microsoft.NETCore.App/<version>/. CORE_ROOT must point at the inner | ||
| version directory so the test harness finds corerun.exe as a sibling of coreclr.dll | ||
| (matches what CdacStressTestBase.GetCoreRunPath expects). |
Comment on lines
+71
to
+74
| The command is built as a list of lines written to a command file (following | ||
| cdac-dump-helix.proj). xUnit runs first; its exit code is captured before the | ||
| archive step (which always succeeds) and re-applied afterwards so a tar failure | ||
| can't mask — or fabricate — a test failure. |
9343d2a to
7b2cd86
Compare
When the cDAC GC stress work item fails, echo the per-debuggee verification logs to the work item's console log so the cDAC-vs-runtime comparison is readable from the test's Helix console-log link -- the same channel the other runtime-diagnostics legs use for diagnostics. The harness already uploads the logs to HELIX_WORKITEM_UPLOAD_ROOT; this just surfaces them inline on a failing run without adding any pipeline code. xUnit's exit code is captured before the (always-succeeding) log dump and re-applied afterwards, so dumping logs cannot mask or fabricate a test result. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7b2cd86 to
9f357f7
Compare
Comment on lines
+95
to
+96
| <_HelixCommandLines Condition="'$(TargetOS)' == 'windows'" | ||
| Include="if %25test_exit_code%25 NEQ 0 type %25HELIX_WORKITEM_UPLOAD_ROOT%25\cdac-gcstress-*.txt" /> |
Comment on lines
+97
to
+98
| <_HelixCommandLines Condition="'$(TargetOS)' != 'windows'" | ||
| Include="if [ %24test_exit_code -ne 0 ]%3B then echo '===== cDAC stress verification logs ====='%3B for f in %24HELIX_WORKITEM_UPLOAD_ROOT/cdac-gcstress-*.txt%3B do echo "--- %24f ---"%3B cat "%24f"%3B done%3B fi" /> |
Comment on lines
113
to
117
| <HelixWorkItem Include="CdacStressTests"> | ||
| <PayloadDirectory>$(StressTestsPayload)</PayloadDirectory> | ||
| <Command>$(_StressTestCommand)</Command> | ||
| <Command>$([System.IO.File]::ReadAllText('$(_HelixCommandFile)'))</Command> | ||
| <Timeout>$(WorkItemTimeout)</Timeout> | ||
| </HelixWorkItem> |
Member
Author
|
Abandoning this approach; superseding with a focused change. |
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.
Summary
The cDAC GC stress tests in the
runtime-diagnosticspipeline write rich per-debuggee verification logs (cDACGetStackReferencesvs the runtime GC-root oracle) toHELIX_WORKITEM_UPLOAD_ROOT. That location only uploads to Helix blob storage, so the ADO build UI only surfaced the xUnit pass/fail plus the assert text -- the full comparison output was effectively invisible, making failing runs hard to triage.Helix and ADO are separate systems; the only automatic bridge is the test-results reporter (
testResults.xml-> ADO Tests tab). Getting arbitrary files into ADO requires explicitly pulling them back to the agent (DownloadFilesFromResults) and publishing them (PublishPipelineArtifact) -- which the stress leg omitted but the sibling dump leg already does.Changes
CdacStressTestBase.cs-- write per-debuggee logs into a dedicatedcdac-stress-logssubdirectory of the upload root, so the work item can archive a clean directory without self-including the tarball ortestResults.xml.cdac-stress-helix.proj-- convert the work item command to a command-file (matchingcdac-dump-helix.proj): run xUnit, capture the exit code,tarthe logs into a known-namedcdac-stress-logs.tar.gz, then re-apply the test exit code (archive failures stay non-fatal). Declare the tarball viaDownloadFilesFromResults(exact names only -- no wildcard support -- hence a single archive).runtime-diagnostics.yml(CdacStressTest leg) -- publishartifacts/helixresults(the defaultHelixResultsDestinationDir) as a pipeline artifact,condition: always().Validation
cdac-stress-helix.projXML andruntime-diagnostics.ymlparse cleanly.cdac-stress-logssubdirectory.Note
This PR description and the code changes were generated with the assistance of GitHub Copilot.