)
        assert set([dr.run_id for dr in [dr1, dr2, dr3]]) == set(
            [
                ti.run_id
                for ti in test_dag.get_task_instances_before(base_date=REF_DATE, num=3, session=session)
            ]
        )
        assert set([dr.run_id for dr in [dr1, dr2, dr3, dr4, dr5]]) == set(
            [
                ti.run_id
                for ti in test_dag.get_task_instances_before(base_date=REF_DATE, num=5, session=session)
            ]
        )
        assert set([dr.run_id for dr in [dr1, dr2, dr3, dr4, dr5, dr6, dr7]]) == set(
            [
                ti.run_id
                for ti in test_dag.get_task_instances_before(base_date=REF_DATE, num=7, session=session)
            ]
        )
        assert set([dr.run_id for dr in [dr1, dr2, dr3, dr4, dr5, dr6, dr7, dr8]]) == set(
            [
                ti.run_id
                for ti in test_dag.get_task_instances_before(base_date=REF_DATE, num=9, session=session)
            ]
        )
        assert set([dr.run_id for dr in [dr1, dr2, dr3, dr4, dr5, dr6, dr7, dr8]]) == set(
            [
                ti.run_id
                for ti in test_dag.get_task_instances_before(base_date=REF_DATE, num=10, session=session)
            ]