WaitUntilAsync(Func<bool, CancellationToken, Task<bool>>, TimeSpan, TimeSpan?, CancellationToken, string?)
static
public static Task WaitUntilAsync(Func<bool, CancellationToken, Task<bool>> predicate, TimeSpan timeout, TimeSpan? delayOnFail = null, CancellationToken cancellationToken = default(CancellationToken), string? predicateExpression = null)Run the predicate until it succeeds or times out.
Parameters
predicateFunc<bool, CancellationToken, Task<bool>>- The predicate to run. The first argument indicates the final attempt, allowing the predicate to throw a detailed assertion failure. The token is cancelled when the deadline expires or cancellation is requested.
timeoutTimeSpan- The timeout value.
delayOnFailTimeSpan?- The delay before retrying after an unsuccessful attempt.
cancellationTokenCancellationToken- The cancellation token.
predicateExpressionstring?- The expression supplied for
predicate.
Returns
A task representing the operation.
Exceptions
System.TimeoutException- The predicate did not succeed before the timeout elapsed.
