kaxil commented on code in PR #64109:
URL: https://github.com/apache/airflow/pull/64109#discussion_r4243926259
##########
airflow-core/tests/unit/jobs/test_scheduler_job.py:
##########
@@ -4477,6 +4480,94 @@ def
test_runs_are_created_after_max_active_runs_was_reached(self, dag_maker, ses
dag_runs = DagRun.find(dag_id=dag.dag_id, session=session)
assert len(dag_runs) == 2
+ def test_runs_are_not_starved_by_max_active_runs_limit(self, dag_maker,
session):
Review Comment:
This one also passes with `dagrun.py` reverted to main (checked in breeze),
same as ashb's point on the test below. The three Dags share `start_date` and
schedule, so their queued runs interleave by `run_after`, main's top 20 holds
about 7 per Dag, and the Python guard still starts 3 of each.
To fail on main, one Dag's backlog has to sort entirely ahead of a Dag that
has capacity. For example: Dag A with `max_active_runs=1` and 25 queued runs,
Dag B starting a day later with `max_active_runs=3` and 5 queued runs, then
assert `{A: 1, B: 3}` running. Main gives `{A: 1}` and this branch passes.
##########
airflow-core/tests/unit/jobs/test_scheduler_job.py:
##########
@@ -4477,6 +4480,94 @@ def
test_runs_are_created_after_max_active_runs_was_reached(self, dag_maker, ses
dag_runs = DagRun.find(dag_id=dag.dag_id, session=session)
assert len(dag_runs) == 2
+ def test_runs_are_not_starved_by_max_active_runs_limit(self, dag_maker,
session):
Review Comment:
This one also passes with `dagrun.py` reverted to main (checked in breeze),
same as @ashb 's point on the test below. The three Dags share `start_date` and
schedule, so their queued runs interleave by `run_after`, main's top 20 holds
about 7 per Dag, and the Python guard still starts 3 of each.
To fail on main, one Dag's backlog has to sort entirely ahead of a Dag that
has capacity. For example: Dag A with `max_active_runs=1` and 25 queued runs,
Dag B starting a day later with `max_active_runs=3` and 5 queued runs, then
assert `{A: 1, B: 3}` running. Main gives `{A: 1}` and this branch passes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]