-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document RetryBaseAttribute/RetryAttribute introduced in MSTest 3.8 #44635
base: main
Are you sure you want to change the base?
Conversation
### `RetryBaseAttribute` | ||
|
||
The `RetryBaseAttribute` was introduced in MSTest 3.8. It's an abstract attribute that encapsulates a retry logic to be used when a test fails or timeouts. Implementors of this attribute must implement `ExecuteAsync` method which takes `RetryContext` as a parameter. Whenever a test times out or fails and an implementation of `RetryBaseAttribute` is present on the test method, MSTest will call `ExecuteAsync` of the attribute. | ||
|
||
> [!NOTE] | ||
> `RetryBaseAttribute.ExecuteAsync` is currently marked as experimental API. | ||
> | ||
> [!NOTE] | ||
> MSTest provides a built-in implementation of `RetryBaseAttribute`, named `RetryAttribute`. | ||
> The built-in `RetryAttribute` allows to control the maximum number of retry attempts, time delay between retries, and a delay backoff type which is either constant or exponential. You can check out the implementation of `RetryAttribute` on [GitHub](https://github.com/microsoft/testfx/blob/27e0f3da163f3cd651e34395c8759772012b55f9/src/TestFramework/TestFramework/Attributes/TestMethod/RetryAttribute.cs) to have better understanding of how to implement your own custom `RetryBaseAttribute`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably do the opposite and describe here RetryAttribute
that is what is useful to end users. We can mention RetryBaseAttribute
in a note saying that it allows for user-provided attributes or we could just not mention it here and add a new documentation page about MSTest extensibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Evangelink Does it look better now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe drop the first note
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Evangelink Which note? About experimental? That one is already dropped
Fixes microsoft/testfx#4689
cc @Evangelink
Internal previews