Skip to content

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

Closed

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.

Activity

  1. added
    area/mtp
    needs/design
    and removed
    needs/triage
    on Oct 22, 2025
  2. nohwnd commented on Oct 22, 2025

    @nohwnd
    Member

    I think we need to start a diagnostic epic, and focus on how to debug / prevent hangs in Azdo / gh actions / other CI systems. And collect the dumps etc.

    I also don't like that when crash happens I have to dig deep to even see that some tests crashed.

  3. cbersch commented on Oct 22, 2025

    @cbersch

    Our workaround was until now to parse the sequence files, which were created when running with --blame. I haven't checked, yet, if these files are still created.

  4. Youssef1313 commented on Jan 17, 2026

    @Youssef1313
    Member
    • VSTest's sequence files are not supported in MTP (yet) AFAIK.
    • Producing a TRX when hang triggers is very possible to do.
  5. removed
    needs/design
    on Mar 11, 2026
  6. Evangelink commented on May 16, 2026

    @Evangelink
    Member

    This should be addressed by PR #8263 (Stream TRX test results to disk and recover partial TRX on test host crash), merged in 2026-05-16.

    With the streaming TRX store + out-of-process crash recovery, when HangDump kills the test host the TestHostController now reads back the sidecar and emits a partial TRX containing every test that completed before the hang dump (the crash banner is preserved).

    Closing as fixed. Please reopen if you still see the issue on a build that includes #8263.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/mtparea/trx

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions