Skip to content

Enable MTP crash/hang dump extensions and wire them into Helix - #55133

Merged
Evangelink merged 2 commits into
mainfrom
dev/amauryleve/mtp-dump-extensions
Jul 6, 2026
Merged

Evangelink merged 2 commits into
mainfrom
dev/amauryleve/mtp-dump-extensions

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

Almost all test/ projects use MSTest.Sdk and run on Microsoft.Testing.Platform (MTP). On Helix they are dispatched via the isMTPProject branch of SDKCustomCreateTestWorkItemsWithTestExclusion, which — unlike the legacy VSTest branch — had no crash/hang dump support. This made intermittent CI hangs and crashes hard to diagnose. This PR enables the MTP crash-dump and hang-dump extensions, wires them into the Helix command, ensures the dumps are uploaded, and cleans up stale xUnit-mentioning comments.

Changes

1. Enable the dump extensions (test/Directory.Build.props)

  • Set EnableMicrosoftTestingExtensionsCrashDump=true and EnableMicrosoftTestingExtensionsHangDump=true in the existing UsingMSTestSdk=='true' block. MSTest.Sdk pulls in the Microsoft.Testing.Extensions.CrashDump / .HangDump packages automatically and manages their versions, so no explicit PackageReference or version pin is required.

2. Wire dumps into the Helix MTP command (SDKCustomCreateTestWorkItemsWithTestExclusion.cs)

  • Hoisted the existing blameHangTimeout (80% of the Helix work-item timeout) above the branch so both the MTP and legacy VSTest paths share the same calculation.
  • The MTP branch now appends --crashdump --hangdump --hangdump-timeout <T>m, where T is the shared 80%-of-timeout value, so a hang dump is captured before Helix hard-kills the work item.
  • --crashdump is recognized (and silently no-ops) on the .NET Framework MTP hosts, so this is safe for the net472 rows.

3. Upload both hang and crash dumps (test/UnitTests.proj)

  • The MTP extensions write default filenames ending in _hang.dmp / _crash.dmp, which the old *hangdump.dmp glob missed. Broadened both HelixPostCommands copy globs (Windows PowerShell + POSIX find) to *.dmp, which also still matches the legacy VSTest *hangdump.dmp. macOS crash dumps continue to work via the pre-existing ad-hoc codesign step.

4. Comment cleanup (non-behavioral)

  • Refreshed stale xUnit v3 / VSTest references in the dispatcher, TestRunner.targets, and TestPublish.targets. Comments that still accurately document the retained legacy VSTest branch were left intact.

Validation

  • Verified the MSTest.Sdk property names, the MTP CLI switches, and the default dump filenames against the microsoft/testfx source and the official docs.
  • Confirmed the C# dispatcher change compiles cleanly (isolated Roslyn compile of the HelixTasks sources succeeded with 0 errors).

Notes

Enable the Microsoft.Testing.Platform crash-dump and hang-dump extensions
repo-wide for MSTest.Sdk test projects, pass them through the Helix MTP test
command, ensure the dumps are uploaded, and refresh stale xUnit-mentioning
comments in the Helix dispatch infrastructure.

- test/Directory.Build.props: set EnableMicrosoftTestingExtensionsCrashDump and
  EnableMicrosoftTestingExtensionsHangDump (MSTest.Sdk manages the package
  versions, so no explicit pin is needed).
- SDKCustomCreateTestWorkItemsWithTestExclusion.cs: hoist the shared 80%-of-timeout
  calculation and append --crashdump --hangdump --hangdump-timeout <T>m in the MTP
  branch.
- test/UnitTests.proj: broaden the HelixPostCommands dump-upload globs from
  *hangdump.dmp to *.dmp so the MTP *_hang.dmp / *_crash.dmp are collected.
- Comment-only cleanup of stale xUnit references in the dispatcher and the
  test-runner targets (legacy VSTest branch left intact).

Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 3, 2026 10:49

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.

Pull request overview

Enables Microsoft.Testing.Platform (MTP) crash/hang dump collection for MSTest.Sdk-based test runs on Helix, and ensures resulting dump artifacts are captured and uploaded for CI diagnostics.

Changes:

  • Turn on MTP CrashDump/HangDump extensions for UsingMSTestSdk=true test projects.
  • Extend the Helix MTP work-item command to pass --crashdump --hangdump --hangdump-timeout <T>m.
  • Broaden Helix post-run upload globs to retain both legacy VSTest hang dumps and new MTP dump filenames; update stale comments.
Show a summary per file
File Description
test/UnitTests.proj Uploads any *.dmp artifacts (covers both MTP and legacy VSTest dump naming) from Helix work items.
test/test-runner/TestRunner.targets Comment updates clarifying out-of-process execution and TRX extension behavior.
test/test-runner/TestPublish.targets Comment updates clarifying how MTP detection and TRX extension detection are used by the dispatcher.
test/HelixTasks/SDKCustomCreateTestWorkItemsWithTestExclusion.cs Adds MTP --crashdump/--hangdump arguments and shares the timeout-derived hang timeout between MTP and VSTest branches.
test/Directory.Build.props Enables CrashDump and HangDump extensions for MSTest.Sdk projects via MSBuild properties.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 0

MSBuild rejects '--' inside XML comments; the crashdump/hangdump switch names
in the explanatory comment broke evaluation of every test project. Reword to
avoid the double hyphen.

Co-authored-by: Copilot App <[email protected]>
@Evangelink
Evangelink enabled auto-merge July 3, 2026 13:25
@Evangelink
Evangelink merged commit 011964e into main Jul 6, 2026
25 checks passed
@Evangelink
Evangelink deleted the dev/amauryleve/mtp-dump-extensions branch July 6, 2026 13:55
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview7 milestone Jul 7, 2026
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