def METHOD_NAME(mocker, monkeypatch, db, create_event, dummy_agent):
    """Test a failing queue run"""
    uploader = FailingUploader(TestBackend())
    events = tuple(create_event(id_=evt_id) for evt_id in range(10))
    records = tuple(LiveSyncQueueEntry(change=ChangeType.created, type=EntryType.event, event_id=evt.id,
                                       agent=dummy_agent)
                    for evt in events)
    for rec in records:
        db.session.add(rec)
    db.session.flush()
    db_mock = mocker.patch('indico_livesync.uploader.db')
    monkeypatch.setattr('indico_livesync.simplify._process_cascaded_event_contents',
                        _sorted_process_cascaded_event_contents)
    uploader.run(records)
    assert uploader.logger.exception.called
    # No uploads should happen after a failed batch
    assert not uploader._uploaded
    # No records should be marked as processed
    assert not any(record.processed for record in records)
    # And nothing should have been committed
    db_mock.session.commit.assert_not_called()