Microsoft.Testing.Extensions.Retry 2.5.3

Prefix Reserved
dotnet add package Microsoft.Testing.Extensions.Retry --version 2.5.3
                    
NuGet\Install-Package Microsoft.Testing.Extensions.Retry -Version 2.5.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Testing.Extensions.Retry" Version="2.5.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Testing.Extensions.Retry" Version="2.5.3" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Testing.Extensions.Retry" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Testing.Extensions.Retry --version 2.5.3
                    
#r "nuget: Microsoft.Testing.Extensions.Retry, 2.5.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Testing.Extensions.Retry@2.5.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Testing.Extensions.Retry&version=2.5.3
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Testing.Extensions.Retry&version=2.5.3
                    
Install as a Cake Tool

Microsoft.Testing.Extensions.Retry

Microsoft.Testing.Extensions.Retry is an extension for Microsoft.Testing.Platform that provides test resilience and transient-fault handling by rerunning failed tests.

Microsoft.Testing.Platform is open source. You can find Microsoft.Testing.Extensions.Retry code in the microsoft/testfx GitHub repository.

Install the package

dotnet add package Microsoft.Testing.Extensions.Retry

About

This package extends Microsoft.Testing.Platform with:

  • Automatic retry: automatically re-runs failed tests up to a configurable number of times
  • Retry guards: can stop retries when failure thresholds are exceeded (--retry-failed-tests-max-percentage, --retry-failed-tests-max-tests)
  • Retry delay: optionally wait between retry attempts (--retry-failed-tests-delay)
  • Integration-test focus: intended for scenarios where transient environment issues can cause intermittent failures

Usage

Configure retry using --retry-failed-tests <retries>, and optionally limit retries with --retry-failed-tests-max-percentage or --retry-failed-tests-max-tests, or add a delay between retries with --retry-failed-tests-delay (e.g. 1s, 2.5m, 1h).

This extension restarts the test host for each retry. It is independent from MSTest's in-process RetryAttribute and custom RetryBaseAttribute implementations. When both mechanisms are enabled, their attempt counts multiply: a test using [Retry(n)] can run up to (n + 1) * (--retry-failed-tests + 1) times.

When --report-trx uses its default filename or a relative .trx filename, earlier attempts' TRX reports remain under Retries/<id>/<attempt>/, and the final attempt's TRX report is moved to the configured results directory. Collect these attempt reports with **/*.trx recursively from that directory to include every physical attempt exactly once. The top-level TRX represents only the final attempt, which may contain just the tests selected for retry; publishing only that file can omit tests that passed earlier. An absolute report filename keeps its explicitly configured location.

Only identified TRX report artifacts are moved. Test attachments remain at their recorded paths, even when their filenames end in .trx, so reports such as CTRF can still reference them.

If the .NET SDK also performs artifact post-processing and writes an additional merged report, publish either that merged report or its input reports, not both.

Documentation

For this extension, see https://learn.microsoft.com/dotnet/core/testing/microsoft-testing-platform-retry.

For comprehensive documentation, see https://aka.ms/testingplatform.

Feedback & contributing

Microsoft.Testing.Platform is an open source project. Provide feedback or report issues in the microsoft/testfx GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Microsoft.Testing.Extensions.Retry:

Package Downloads
MSTest.TestAdapter

This package includes the adapter logic to discover and run tests. For access to the testing framework, install the MSTest.TestFramework package. Supported platforms: - .NET 4.6.2+ - .NET 8.0+ - .NET 8.0 Windows.18362+ (WinUI) - UWP 10.0.16299 - UWP 10.0.17763 with .NET 9 MSTest is Microsoft supported Test Framework.

Soneta.Test

Składnik programu Soneta. Program obsługi firmy: kadry-płace, księgowość, handel, magazyn, CRM, BI ...

Headless.NET.Sdk.Test

An opinionated MSBuild SDK family for consistent project evaluation, mandatory analyzer infrastructure, configurable banned-API policy, CI quality gates, packaging defaults, and Microsoft Testing Platform support across compatible .NET projects. Distributed through GitHub Packages and NuGet.org; no license is currently granted.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on Microsoft.Testing.Extensions.Retry:

Repository Stars
dotnet/sdk
Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
dotnet/dotnet
Home of .NET's Virtual Monolithic Repository which includes all the code needed to build the .NET SDK.
blehnen/DotNetWorkQueue
A work queue for dot.net with SQL server, SQLite, LiteDB, Redis and PostGreSQL backends
Version Downloads Last Updated
2.5.3 0 11/11/2026
2.5.2 46,831 10/27/2026
2.5.1 127,326 10/7/2026
2.5.0 77,816 10/6/2026
2.4.1 100,340 9/16/2026
2.4.0 72,693 9/2/2026
2.3.3 269,262 7/28/2026
2.3.2 190,443 7/13/2026
2.3.1 27,286 7/8/2026
2.3.0 2,321 7/7/2026
2.2.3 214,509 5/14/2026
2.2.2 34,168 4/30/2026
2.2.1 264,690 4/7/2026
2.1.0 122,363 2/3/2026
2.0.2 162,527 11/11/2025
2.0.1 5,628 10/14/2025
2.0.0 868 10/7/2025
1.9.1 53,740 11/11/2025
1.9.0 6,371 10/1/2025
1.8.5 15,864 9/30/2025
Loading failed