Develop Retry Attribute for TestMethod
Summary
I'm curious to know if there's any built-in mechanism to retry tests. Case in point, I have a unit test code something like this:
[TestMethod]
public async Task Get_Banner_ReturnOK()
{
//tests
}
Im just looking for something I Can retry this TestMethod Twice or more, something like this:
[TestMethod]
[Retry(2)]
public async Task Get_Banner_ReturnOK()
{
//tests
}
When using MSTest runner, you can opt-in for the retry extension (see https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-extensions-policy#retry) that would allow for a global retry policy feature but at the moment nothing is designed to allow retry at test level.
This is something we are planning to bring (cc @MarcoRossignoli and @nohwnd).
opt-in for the retry extension (see https://learn.microsoft.com/dotnet/core/testing/unit-testing-platform-extensions-policy#retry)
I see, It's looks better
I'll keep this issue opn as we do plan to have this feature or something similar.