ti.refresh_from_task(task1)
    ti.run()
    task2 = dag.get_task("task_2")
    for ti in dr.get_task_instances():
        if ti.map_index < 0:
            ti.task = task1
        else:
            ti.task = task2
            ti.state = TaskInstanceState.SUCCESS
        session.merge(ti)
    session.flush()
    
    dr.verify_integrity()
    tis = dr.get_task_instances()
    indices = [(ti.map_index, ti.state) for ti in tis if ti.map_index >= 0]
    assert sorted(indices) == [
        (0, TaskInstanceState.SUCCESS),
        (1, TaskInstanceState.REMOVED),
        (2, TaskInstanceState.REMOVED),
    ]
    
    dr.verify_integrity()
    tis = dr.get_task_instances()
    indices = [(ti.map_index, ti.state) for ti in tis if ti.map_index >= 0]
    assert sorted(indices) == [
        (0, TaskInstanceState.SUCCESS),
        (1, TaskInstanceState.REMOVED),
        (2, TaskInstanceState.REMOVED),
    ]
def test_calls_to_verify_integrity_with_mapped_task_with_no_changes_at_runtime(dag_maker, session):