def METHOD_NAME(self, errclass, errno, errmsg, backoff_sleep_mock):
    """The method is retried on a retriable exception."""
    count = 0
    @retry_on_mysql_lock_fail()
    def raise_first_time():
        nonlocal count
        count += 1
        if count < 2:
            self._raise_mysql_error(errclass, errno, errmsg)
    raise_first_time()
    assert count == 2
    assert backoff_sleep_mock.call_count == 1