dag = DAG("test_dagrun_no_deadlock", start_date=DEFAULT_DATE)
        with dag:
            EmptyOperator(task_id="dop", depends_on_past=True)
            EmptyOperator(task_id="tc", max_active_tis_per_dag=1)
        dag.clear()
        dr = dag.create_dagrun(
            run_id="test_dagrun_no_deadlock_1",
            state=DagRunState.RUNNING,
            execution_date=DEFAULT_DATE,
            data_interval=dag.timetable.infer_manual_data_interval(run_after=DEFAULT_DATE),
            start_date=DEFAULT_DATE,
        )
        next_date = DEFAULT_DATE + datetime.timedelta(days=1)
        dr2 = dag.create_dagrun(
            run_id="test_dagrun_no_deadlock_2",
            state=DagRunState.RUNNING,
            execution_date=next_date,
            data_interval=dag.timetable.infer_manual_data_interval(run_after=next_date),
            start_date=next_date,
        )
        ti1_op1 = dr.get_task_instance(task_id="dop")
        dr2.get_task_instance(task_id="dop")
        ti2_op1 = dr.get_task_instance(task_id="tc")
        dr.get_task_instance(task_id="tc")
        ti1_op1.set_state(state=TaskInstanceState.RUNNING, session=session)
        dr.update_state()
        dr2.update_state()