Instead of just checking that the function returns, check that it returns an error 5 times and eventually succeeds on the sixth try.
To make this work, the TestServer can now re-enqueue work for the next execute() iteration, and the order of responses returned by the app is preserved.
Instead of just checking that the function returns, check that it returns an error 5 times and eventually succeeds on the sixth try.
To make this work, the TestServer can now re-enqueue work for the next execute() iteration, and the order of responses returned by the app is preserved.