Skip to content

Comments

[runtime-diagnostics] Publish test dumps on failure#124821

Draft
max-charlamb wants to merge 1 commit intodotnet:mainfrom
max-charlamb:runtime-diagnostics-publish-on-failure
Draft

[runtime-diagnostics] Publish test dumps on failure#124821
max-charlamb wants to merge 1 commit intodotnet:mainfrom
max-charlamb:runtime-diagnostics-publish-on-failure

Conversation

@max-charlamb
Copy link
Member

No description provided.

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the runtime-diagnostics Azure Pipelines definition to automatically publish crash dumps and test logs as pipeline artifacts when diagnostics test jobs fail, improving failure triage for cDAC/DAC runs.

Changes:

  • Publish crash dumps (artifacts/tmp/$(_BuildConfig)/dumps) as a pipeline artifact on failures.
  • Publish test results and SOS logs (artifacts/TestResults) as a pipeline artifact on failures.
  • Apply the above to both the cDAC and DAC diagnostics jobs.

Comment on lines +164 to +171
condition: failed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_DAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: failed()
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, condition: failed() can skip artifact publication when the job ends SucceededWithIssues due to continueOnError. If publishing logs/results is intended for any failure/issue, update the condition to also match SucceededWithIssues.

Suggested change
condition: failed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_DAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: failed()
condition: or(failed(), eq(variables['Agent.JobStatus'], 'SucceededWithIssues'))
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_DAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: or(failed(), eq(variables['Agent.JobStatus'], 'SucceededWithIssues'))

Copilot uses AI. Check for mistakes.
Comment on lines +116 to +123
condition: failed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_cDAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: failed()
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

condition: failed() likely won’t run when tests fail but the job ends as SucceededWithIssues (e.g., PublishTestResults@2 has continueOnError: true). Consider using a condition that also matches Agent.JobStatus == 'SucceededWithIssues' (e.g., in(variables['Agent.JobStatus'], 'Failed', 'SucceededWithIssues')) so dumps get published on test failures as well.

Suggested change
condition: failed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_cDAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: failed()
condition: in(variables['Agent.JobStatus'], 'Failed', 'SucceededWithIssues')
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_cDAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: in(variables['Agent.JobStatus'], 'Failed', 'SucceededWithIssues')

Copilot uses AI. Check for mistakes.
Comment on lines +116 to +123
condition: failed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_cDAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: failed()
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as above: with continueOnError: true on PublishTestResults@2, the job may be SucceededWithIssues rather than Failed, so condition: failed() may skip publishing the TestResults/SOS logs artifact. Adjust the condition to include SucceededWithIssues if the goal is to publish whenever tests fail.

Suggested change
condition: failed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_cDAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: failed()
condition: or(failed(), eq(variables['Agent.JobStatus'], 'SucceededWithIssues'))
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_cDAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: or(failed(), eq(variables['Agent.JobStatus'], 'SucceededWithIssues'))

Copilot uses AI. Check for mistakes.
Comment on lines +164 to +171
condition: failed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_DAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: failed()
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

condition: failed() may not trigger when the job result is SucceededWithIssues (e.g., test failures reported by PublishTestResults@2 with continueOnError: true). If you want dumps on any test failure, include SucceededWithIssues in the condition (e.g., in(variables['Agent.JobStatus'], 'Failed', 'SucceededWithIssues')).

Suggested change
condition: failed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_DAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: failed()
condition: in(variables['Agent.JobStatus'], 'Failed', 'SucceededWithIssues')
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)/artifacts/TestResults'
artifactName: 'TestResults_DAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)'
displayName: 'Publish Test Results and SOS Logs'
continueOnError: true
condition: in(variables['Agent.JobStatus'], 'Failed', 'SucceededWithIssues')

Copilot uses AI. Check for mistakes.
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.

1 participant