# TestingUtils.WaitUntilAsync(Func&lt;bool, Task&lt;bool&gt;&gt;, TimeSpan, TimeSpan?)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.utils.testingutils/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.testinghost/orleans.testinghost.utils.testingutils/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.TestingHost/Utils/TestingUtils.cs#L81-L108)

```csharp
public static Task WaitUntilAsync(Func<bool, Task<bool>> predicate, TimeSpan timeout, TimeSpan? delayOnFail = null)
```

Run the predicate until it succeed or times out

### Parameters

- `predicate` (`Func<bool, Task<bool>>`): The predicate to run
- `timeout` (`TimeSpan`): The timeout value
- `delayOnFail` (`TimeSpan?`): The time to delay next call upon failure

### Returns

True if the predicate succeed, false otherwise
