Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: HTML Report flaky test detection and summary not showing #6119

Description

@pmoskala

Description

When using TUnit retry functionality (e.g. [assembly: Retry(3)]), retries are executed correctly, but the generated HTML report does not display retry information.

The report renderer contains support for:

Retry badges (↻n)
"Flaky in this run" panel
Attempt timeline (attempts section)

However, the generated report payload only contains the final test result and retry-related span attributes (tunit.test.retry_attempt), but does not contain the attempts collection expected by the UI.

As a result, tests that fail and later pass are shown as ordinary passing tests with no indication that retries occurred.

Expected Behavior

When a test is retried:

The report should display retry information.
Tests that eventually pass after one or more failures should be marked as flaky.
The "Flaky in this run" panel should contain the test.
Retry badges should be visible in the test list.
Attempt history should be available in the test details view.

Actual Behavior

Retries are executed correctly, but no retry information is displayed in the report.

The report shows:

Test status = Passed
No retry badge
No flaky test entry
No attempt timeline

Steps to Reproduce

  1. Create a test that fails several times before passing:
private static int _attempt;

[Test]
public void RetryTest()
{
    _attempt++;

    Console.WriteLine($"Attempt {_attempt}");

    if (_attempt < 3)
    {
        Assert.Fail();
    }
}
  1. Enable retries:
[assembly: Retry(3)]
  1. Execute the tests.
  2. Open the generated HTML report.
    The test passes.

Output contains:

Attempt 1
Attempt 2
Attempt 3

Retry spans are present in the report payload.
No retry badge, flaky marker, or attempt history is displayed in the report.

TUnit Version

1.47.0

.NET Version

.NET 10.0

Operating System

Windows

IDE / Test Runner

dotnet CLI (dotnet test / dotnet run)

Error Output / Stack Trace

Additional Context

No response

IDE-Specific Issue?

  • I've confirmed this issue occurs when running via dotnet test or dotnet run, not just in my IDE

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