def test_retry_on_normal_error(collect):
    """Ensure retries are processed for most errors."""
    key_name = 'test-key-name'
    b = B(name=key_name)

    collect.inject(Exception('Normal error'))
    d = wabs_deleter.Deleter(BlobService('test', 'ing'), 'test-container')
    d.delete(b)

    # Since delete_keys will fail over and over again, aborted_keys
    # should grow quickly.
    while 2 < len(collect.aborted_keys):
        gevent.sleep(0.1)

    # Since delete_keys has been failing repeatedly, no keys should be
    # successfully deleted.
    assert not collect.deleted_keys

    # Turn off fault injection and flush/synchronize with close().
    collect.inject(None)
    d.close()

    # The one enqueued job should have been processed.n
    assert collect.deleted_keys == [key_name]
dataset/ETHPy150Open wal-e/wal-e/tests/test_wabs_deleter.py/test_retry_on_normal_error/swapped operands of `<`