You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/02/03 10:59:36 UTC

[GitHub] [airflow] ephraimbuddy commented on a change in pull request #21214: Removes the next_dagrun_create_after reset

ephraimbuddy commented on a change in pull request #21214:
URL: https://github.com/apache/airflow/pull/21214#discussion_r798445086



##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -2937,20 +2975,12 @@ def test_more_runs_are_not_created_when_max_active_runs_is_reached(self, dag_mak
         self.scheduler_job.executor = MockExecutor(do_update=False)
         self.scheduler_job.processor_agent = mock.MagicMock(spec=DagFileProcessorAgent)
         session = settings.Session()
-        assert session.query(DagRun).count() == 0
-        dag_models = DagModel.dags_needing_dagruns(session).all()
-        self.scheduler_job._create_dag_runs(dag_models, session)
-        dr = session.query(DagRun).one()
-        dr.state == DagRunState.QUEUED
-        assert session.query(DagRun).count() == 1
-        assert dag_maker.dag_model.next_dagrun_create_after is None
+        self.scheduler_job._do_scheduling(session)

Review comment:
       Using `_do_scheduling` directly is flaky and your code here didn't check that when max_active_runs is reached that more dagruns are not created




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org