Skip to content

When HangDump extension triggers, test run does not produce a .trx file #6778

@vikukush

Description

@vikukush

Describe the bug

When one of tests hangs and Microsoft.Testing.Extensions.HangDump triggers, the test run does not produce a .trx file with results.

Steps To Reproduce

  1. Make one of your tests hang
  2. Add Microsoft.Testing.Extensions.HangDump to your project
  3. Run the tests with --report-trx flag

Expected behavior

Hanged test is dumped, .trx file with test results is produced:

  1. Tests that ran to completion before the hang have their results (pass or fail) properly recorded
  2. Hanged test(s) are marked as such in some form
  3. Tests that didn't get to run due to the hang are marked as Unknown or NotStarted or whatever's most appropriate

Actual behavior

Running tests using MSTest Runner [D:\Test\TestAssemblies\MS.Dynamics.Platform.Integration.Office.ScenarioTests.DocumentManagement.exe]
MSTest v3.10.0 (UTC 7/29/2025) [x64 - .NET Framework 4.8.4795.0]
Diagnostic file (level 'Trace' with async flush): D:\data\CHT\df0c8ed9\UserLogs\a5dbfee2\TestResults\log_251021041813979.diag
Diagnostic file (level 'Trace' with async flush): D:\data\CHT\df0c8ed9\UserLogs\a5dbfee2\TestResults\log_251021041818744.diag
Runsettings datacollectors are not supported by Microsoft.Testing.Platform and will be ignored
Runsettings attribute 'TargetPlatform' is not supported by Microsoft.Testing.Platform and will be ignored
Hang dump timeout of '00:20:00' expired
The following tests were still running when dump was taken (format: [<time-elapsed-since-start>] <name>):
[00:19:54] TestDocumentHandlingCreatesDocumentForNewTypeInNonDefaultCompany
Creating dump file 'D:\data\CHT\df0c8ed9\UserLogs\a5dbfee2\TestResults\MS.Dynamics.Platform.Integration.Office.ScenarioTests.DocumentManagement_8668_hang.dmp'
Test application process didn't exit gracefully, exit code is '7'

Additional context

Without an output .trx file it's impossible to understand in automation (CloudTest/QTest) what exactly happened. We'll be forced to try parsing tool's stdout manually and pray that the output text format won't change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: MTPBelongs to the Microsoft.Testing.Platform core libraryNeeds: DesignNeeds research and proposal for how the feature will be implemented.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions