kaxil commented on code in PR #73032:
URL: https://github.com/apache/airflow/pull/73032#discussion_r4195022220
##########
airflow-core/tests/unit/jobs/test_scheduler_job.py:
##########
@@ -6039,34 +6039,42 @@ def test_should_use_info_from_timetable(self,
mock_create, mock_next, expected,
)
assert actual == expected
+ @pytest.mark.parametrize("timed_out", [False, True], ids=["finished",
"timed_out"])
@pytest.mark.parametrize(
("run_type", "expected"),
[
(DagRunType.MANUAL, True),
(DagRunType.SCHEDULED, True),
(DagRunType.BACKFILL_JOB, False),
(DagRunType.ASSET_TRIGGERED, True),
+ (DagRunType.OPERATOR_TRIGGERED, True),
+ (DagRunType.ASSET_MATERIALIZATION, True),
],
ids=[
DagRunType.MANUAL.name,
DagRunType.SCHEDULED.name,
DagRunType.BACKFILL_JOB.name,
DagRunType.ASSET_TRIGGERED.name,
+ DagRunType.OPERATOR_TRIGGERED.name,
+ DagRunType.ASSET_MATERIALIZATION.name,
],
)
- def test_should_update_dag_next_dagruns_after_run_type(self, run_type,
expected, session, dag_maker):
+ def test_should_update_dag_next_dagruns_after_run_type(
Review Comment:
Nit, since this PR already reworks the signature: the name and docstring
still describe "next dag run is updated", but since #60006 the thing this test
checks is whether `_set_exceeds_max_active_runs` gets called. The
`calculate_dagrun_date_fields` patch and `assert not mock_calc.called` are now
a no-op: `_schedule_dag_run` no longer calls it, so that assertion passes for
every case. Could you rename it to something like
`test_exceeds_max_active_runs_recomputed_for_finished_non_backfill_runs`,
update the docstring, and drop the `mock_calc` patch? Optionally,
`patch.object(SchedulerJobRunner, "_set_exceeds_max_active_runs",
autospec=True)` instead of the bare `MagicMock()`.
--
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]