remove unused import
reduce code duplication in tests
make sure we actually test the retry logic