def METHOD_NAME(mocker, app, db, es, minimal_record):
    # Make the datacite API unavailable
    dc_mock = mocker.patch(
        'invenio_pidstore.providers.datacite.DataCiteMDSClient')
    dc_mock().metadata_post.side_effect = datacite.errors.HttpError()
    # Create a reserved recid
    record = Record.create(minimal_record)
    record_uuid = record.id
    recid = record['recid']
    recid_pid = PersistentIdentifier.create(
        'recid', recid, status=PIDStatus.RESERVED)
    # Mint the record
    zenodo_record_minter(record_uuid, record)
    record.commit()
    db.session.commit()
    with pytest.raises(datacite.errors.HttpError):
        datacite_register.apply((recid_pid.pid_value, str(record_uuid)))
    # Check that the task was retried ("max_retries" + 1) times
    dc_calls = len(dc_mock().metadata_post.mock_calls)
    assert dc_calls == datacite_register.max_retries + 1