Skip to content

fix: global Retry(3) on InvokableTestBase masks flaky tests #4878

@thomhurst

Description

@thomhurst

Description

File: TUnit.Engine.Tests/InvokableTestBase.cs (Line 11)

[Retry(3)]
public abstract class InvokableTestBase(TestMode testMode)

ALL tests inheriting from InvokableTestBase automatically retry 3 times. This masks intermittent issues and makes it impossible to distinguish between flaky tests and genuine failures.

Impact

  • Root causes of intermittent failures hidden
  • Test execution time inflated when retries trigger
  • Test results less reliable for decision-making

Suggested Fix

  • Move [Retry(3)] to specific test classes that actually need it
  • Document why specific tests need retries
  • Track and report actual retry counts in CI logs

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