Skip to content

Commit

Permalink
Collect hang dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
jander-msft committed Jun 22, 2021
1 parent 06f6967 commit 33141b3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
<!-- Build tools -->
<MicrosoftNetCompilersVersion>3.0.0</MicrosoftNetCompilersVersion>
<!-- Use `dotnet test` to have the ability to collect dumps on hanging tests. -->
<UseVSTestRunner>true</UseVSTestRunner>
<MicrosoftTestPlatformVersion>16.10.0</MicrosoftTestPlatformVersion>
<!-- CoreFX -->
<SystemReflectionMetadataVersion>5.0.0</SystemReflectionMetadataVersion>
<MicrosoftWin32PrimitivesVersion>4.3.0</MicrosoftWin32PrimitivesVersion>
Expand Down
22 changes: 20 additions & 2 deletions eng/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ jobs:
# Publish test results to Azure Pipelines
- task: PublishTestResults@2
inputs:
testResultsFormat: xUnit
testResultsFiles: '**/*UnitTests*.xml'
testResultsFormat: VSTest
testResultsFiles: '**/*UnitTests*.trx'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults'
failTaskOnFailedTests: true
testRunTitle: 'Tests $(_PhaseName) $(_BuildArch) $(_BuildConfig)'
Expand All @@ -223,3 +223,21 @@ jobs:
buildConfiguration: ${{ parameters.name }}
continueOnError: true
condition: ne(variables['_BuildOnly'], 'true')

- task: CopyFiles@2
displayName: Gather Test Dumps
inputs:
sourceFolder: '$(Build.SourcesDirectory)/artifacts/TestResults'
contents: '**/*.dmp'
targetFolder: '$(Build.StagingDirectory)/TestDumps'
continueOnError: true
condition: failed()

- task: PublishBuildArtifacts@1
displayName: Publish Test Dumps
inputs:
PathtoPublish: '$(Build.StagingDirectory)/TestDumps'
PublishLocation: Container
ArtifactName: TestDumps_$(_PhaseName)_$(_BuildArch)_$(_BuildConfig)
continueOnError: true
condition: failed()
4 changes: 4 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
<DebugType>portable</DebugType>
</PropertyGroup>

<PropertyGroup>
<TestRunnerAdditionalArguments>--blame "CollectHangDump;TestTimeout=5m"</TestRunnerAdditionalArguments>
</PropertyGroup>

<Import Condition="'$(DotNetBuildFromSource)' != 'true'"
Project="$(RepositoryEngineeringDir)Analyzers.props" />
</Project>

0 comments on commit 33141b3

Please sign in to comment.