Skip to content

TrxReport 2.4.0 force-kills host on cancellation #11040

Description

Describe the bug

Microsoft.Testing.Extensions.TrxReport 2.4.0 makes controller-backed TRX generation active on supported desktop operating systems even when --crashdump is not used. On the first graceful external cancellation, the controller terminates the child test host before its in-process cancellation path and cleanup hooks can complete.

This regresses working behavior with TrxReport 2.3.3.

Version used

  • Microsoft.Testing.Extensions.TrxReport 2.4.0
  • Microsoft.Testing.Platform 2.4.0
  • .NET 10
  • Reproduced on GitHub-hosted Ubuntu x64 and macOS arm64 runners

Steps To Reproduce

TUnit has four existing integration tests covering test-, class-, assembly-, and session-level cleanup after graceful external cancellation:

https://github.com/thomhurst/TUnit/blob/c50a120a73546c4ca50a519f94193998bec35e28/tests/TUnit.Engine.Tests/ExternalCancellationTests.cs#L22

  1. Run a test application with --report-trx and a long-running test.
  2. Send graceful cancellation/SIGINT to the test application.
  3. Let the test framework handle cancellation and run its cleanup hooks.
  4. Observe that all four marker files written by TUnit cleanup hooks are missing.

Failing CI evidence:

Each test reports successful process cancellation, then fails because its expected cleanup marker does not exist. Reverting only TrxReport from 2.4.0 to 2.3.3 restores previous behavior.

Expected behavior

First/graceful cancellation should allow the child test host and test framework to process cancellation and finish registered cleanup/lifetime hooks. Forceful cancellation may terminate it.

Actual behavior

The controller kills the test host immediately when applicationCancellationToken is canceled, so in-process cleanup cannot complete.

The relevant behavior changed between these versions:

Controller-side lifetime handlers run after process exit, but they cannot recover in-process test-framework cleanup hooks after the child has been killed.

Additional context

TUnit temporarily excludes TrxReport 2.4.0 while retaining the other MTP 2.4.0 packages:

thomhurst/TUnit#6717

Activity

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/mtpMicrosoft.Testing.Platform core library.area/trxTRX report extension.type/regressionRegression from a previous release.

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions