CheckOps home

Tools directory

G

CheckOps

Gradle Test Retry Plugin

The Gradle Test Retry Plugin is an Apache-2.0 plugin from Gradle that retries failed JVM tests to mitigate flakiness, reporting tests that passed on retry as flaky.

Visit website

Latest public signals

Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.

Visit Website

Introduction

The Test Retry Gradle plugin retries failed tests so that flaky tests do not fail the whole build. It works with JUnit 4, JUnit 5 and TestNG through Gradle’s Test task.

You configure maxRetries, maxFailures (to stop retrying when many tests fail, which usually means a real breakage), and failOnPassedAfterRetry to decide whether a test that passed on retry should still fail the build. Filters include or exclude tests by class or annotation, and retries can be limited to the failed tests only.

In the quality loop it reduces flaky-build noise for JVM projects while preserving visibility.

The source code is at gradle/test-retry-gradle-plugin on GitHub under the Apache-2.0 licence, with about 268 stars; the most recent commit was on 10 November 2026.

Features

  1. maxRetries: Number of retry attempts.
  2. maxFailures: Skip retries when too many tests fail.
  3. failOnPassedAfterRetry: Choose strictness for flakes.
  4. Filters: Include or exclude classes and annotations.
  5. Framework support: JUnit 4, JUnit 5 and TestNG.
  6. Develocity integration: Flaky test reporting in build scans.

Pros

  1. Official Gradle plugin: Maintained by Gradle.
  2. Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
  3. Actively maintained: The repository had commits as recent as 10 November 2026.

Cons

  1. Gradle only: Maven users need Surefire’s rerun options.
  2. Can hide bugs: Retries are not fixes.
  3. Longer builds: Retries add time.
plugins { id("org.gradle.test-retry") version "1.6.6" }
tasks.test {
  retry { maxRetries.set(2); maxFailures.set(10); failOnPassedAfterRetry.set(false) }
}

Resources:

Pricing

Gradle Test Retry Plugin is free and open source under the Apache-2.0 licence.

  1. Gradle builds with occasional flaky tests.
  2. Teams using Develocity to track flakiness.

Conclusion

The Test Retry plugin is the sanctioned way to handle flaky tests in Gradle.

Keep maxFailures low so real breakages still fail fast.

On CheckOps, Gradle Test Retry Plugin is filed under the Release & CI gates stage. Related tools listed here include JUnit 5, TestNG, pytest-rerunfailures, Trunk Flaky Tests, BuildPulse and Currents. Before standardising on one, compare recent maintenance activity, the pricing model as your usage grows, and the integrations you rely on today. Information on this page was verified against the official website, documentation and repository on 11 November 2026.

Alternatives

Other tools on CheckOps that cover similar ground. Open a page, or compare one with Gradle Test Retry Plugin side by side.