Unit test for retries