solve(scenarios, maxAttempts) retries an async fn up to maxAttempts times.
Returns the result. If all attempts fail, throws the last error.
scenarios = an array of strings: 'fail' or 'ok:<value>'.
The fn consumes one scenario per call.
Sample tests