Skip to content

Commit 7ca1304

Browse files
Youssef1313Evangelinkgewarren
authored
Document RetryBaseAttribute/RetryAttribute introduced in MSTest 3.8 (#44635)
* Document RetryBaseAttribute/RetryAttribute introduced in MSTest 3.8 * Make doc focus on RetryAttribute with RetryBaseAttribute mentioned as a note * Update docs/core/testing/unit-testing-mstest-writing-tests-attributes.md Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com> --------- Co-authored-by: Amaury Levé <amauryleve@microsoft.com> Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
1 parent b5468ce commit 7ca1304

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/core/testing/unit-testing-mstest-writing-tests-attributes.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,15 @@ The [DoNotParallelize](<xref:Microsoft.VisualStudio.TestTools.UnitTesting.DoNotP
353353
> [!NOTE]
354354
> By default, MSTest runs tests in sequential order so you only need to use this attribute if you have applied the `[Parallelize]` attribute at the assembly level.
355355
356+
### `RetryAttribute`
357+
358+
The `RetryAttribute` was introduced in MSTest 3.8. This attribute causes the test method to be retried when it fails or timeouts. It allows you to specify the maximum number of retry attempts, the time delay between retries, and a delay backoff type, which is either constant or exponential.
359+
360+
Only one `RetryAttribute` is expected to be present on a test method, and `RetryAttribute` cannot be used on methods that are not marked with `TestMethodAttribute`.
361+
362+
> [!NOTE]
363+
> `RetryAttribute` derives from an abstract `RetryBaseAttribute`. You can also create your own retry implementations if the built-in `RetryAttribute` doesn't suite your needs.
364+
356365
## Utilities attributes
357366

358367
### `DeploymentItemAttribute`

0 commit comments

Comments
 (0)