Language

RetryBaseAttribute.ExecuteAsync(RetryContext) Method

Definition

Retries the test method. The details of how retry is done is left to the derived classes. Note that a first run of the method was already executed and failed before this method is called.

protected internal abstract System.Threading.Tasks.Task<Microsoft.VisualStudio.TestTools.UnitTesting.RetryResult> ExecuteAsync(Microsoft.VisualStudio.TestTools.UnitTesting.RetryContext retryContext);
[System.Diagnostics.CodeAnalysis.Experimental("MSTESTEXP", UrlFormat="https://aka.ms/mstest/diagnostics#{0}")]
protected internal abstract System.Threading.Tasks.Task<Microsoft.VisualStudio.TestTools.UnitTesting.RetryResult> ExecuteAsync(Microsoft.VisualStudio.TestTools.UnitTesting.RetryContext retryContext);
abstract member ExecuteAsync : Microsoft.VisualStudio.TestTools.UnitTesting.RetryContext -> System.Threading.Tasks.Task<Microsoft.VisualStudio.TestTools.UnitTesting.RetryResult>
[<System.Diagnostics.CodeAnalysis.Experimental("MSTESTEXP", UrlFormat="https://aka.ms/mstest/diagnostics#{0}")>]
abstract member ExecuteAsync : Microsoft.VisualStudio.TestTools.UnitTesting.RetryContext -> System.Threading.Tasks.Task<Microsoft.VisualStudio.TestTools.UnitTesting.RetryResult>
Protected Friend MustOverride Function ExecuteAsync (retryContext As RetryContext) As Task(Of RetryResult)

Parameters

retryContext
RetryContext

An object to encapsulate the state needed for retry execution.

Returns

Returns a RetryResult object that contains the results of all attempts. The last added element determines the test outcome; under Microsoft.Testing.Platform the earlier attempts are also reported, tagged as superseded, so tooling can surface the retry (attempt count, flaky detection, per-attempt error messages). The VSTest host receives only the final result.

Attributes

Applies to