static async Task StartEndpoint(EndpointRunner endpoint, CancellationTokenSource cts)
{
var token = cts.Token;
try
{
await endpoint.Start(token).ConfigureAwait(false);
}
catch (Exception ex)
{
cts.Cancel();
throw new ScenarioException("Endpoint failed to start", ex);
}
}