Skip to content

fix: cancellation token not propagated in AotConverterGenerator inner loops #4900

@thomhurst

Description

@thomhurst

Description

File: TUnit.Core.SourceGenerator/Generators/AotConverterGenerator.cs (Line 101)

ScanTestParameters accepts a CancellationToken but only calls ThrowIfCancellationRequested() once at the start of the outer loop. Inner loops processing large method bodies or recursive type hierarchies don't check cancellation.

Impact

Long-running generator operations can't be cancelled responsively.

Suggested Fix

Add periodic cancellationToken.ThrowIfCancellationRequested() calls in inner loops.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions