Skip to content

--fail-fast: cancelled tests are not reported, and a failure can appear twice as an "Unhandled exception" node #7119

Closed

Description

@thomhurst

Summary

Two reporting problems remain on --fail-fast runs after #7115.

  1. Extra "Unhandled exception" test node. When fail-fast stops two scheduling phases that run concurrently, the first failure is reported a second time as an extra "Unhandled exception" test node.
  2. Cancelled tests are not reported. Tests that fail-fast cancels before they start get no result node. A run can show total: 1 even though many tests were selected.

Repro

  • Problem 2: TUnit.TestProject --treenode-filter /*/*/KeyedNotInParallelFailFast7074/* --fail-fast --maximum-parallel-tests 1 reports only the failing test. The Waits tests that were cancelled while waiting for their slot do not appear.
  • Problem 1: needs fail-fast to trigger while two phases are running (for example, parallel and keyed tests at the same time).

Notes

Both predate #7084 and #7115; found while fixing the fail-fast host crash in #7115. Expected behaviour is likely that cancelled tests are reported as skipped or cancelled, and that each failure is reported exactly once.

Activity

  1. thomhurst commented on Oct 18, 2026

    @thomhurst
    OwnerAuthor

    Related symptom found while investigating a CI timeout (see #7125). When the session is cancelled (for example by --timeout), the global [NotInParallel] phase logs every remaining queued test as "Unhandled exception in test …" with a TaskCanceledException from NotInParallelLock.EnterExclusiveAsync. That made a plain timeout look like a lock deadlock. Reporting those tests as cancelled, or stopping the loop once the session token is cancelled, would fix both this and the fail-fast reporting gap above. Coordinate with #7115, which also changes TestScheduler.

  2. added a commit that references this issue on Oct 20, 2026
    c078a88
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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions