dimberman commented on a change in pull request #6732: [AIRFLOW-6175] fixes 
scheduler queue bug
URL: https://github.com/apache/airflow/pull/6732#discussion_r354476049
 
 

 ##########
 File path: tests/jobs/test_scheduler_job.py
 ##########
 @@ -188,6 +188,55 @@ def test_process_executor_events(self, mock_stats_incr):
 
         
mock_stats_incr.assert_called_once_with('scheduler.tasks.killed_externally')
 
+    def test_scheduler_executor_overflow(self):
+        """
+        Test that tasks that tasks that are set back to scheduled after
+        """
+        executor = TestExecutor(do_update=True, parallelism=3)
+        session = settings.Session()
+        dag = self.create_test_dag()
+        task = DummyOperator(
+            task_id='dummy',
+            dag=dag,
+            owner='airflow')
+        from datetime import timedelta
+        tis = []
+        for i in range(1,10):
+            ti = TI(task, DEFAULT_DATE + timedelta(days=i))
+            ti.state = State.SCHEDULED
+            tis.append(ti)
+            session.merge(ti)
+        session.commit()
+
+        simple_dag_bag = self._make_simple_dag_bag([dag])
+        scheduler = SchedulerJob(num_runs=1,
+                                 executor=executor,
+                                 subdir=os.path.join(settings.DAGS_FOLDER,
+                                                     "no_dags.py"))
+        mock.patch.object(scheduler, 
'_change_state_for_tis_without_dagrun').start()
 
 Review comment:
   Yes. Otherwise the tasks won't run because they don't have an associated 
DagRun.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to