ephraimbuddy commented on a change in pull request #17265:
URL: https://github.com/apache/airflow/pull/17265#discussion_r682638806
##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -119,10 +119,18 @@ def clean_db():
# DO NOT try to run clear_db_serialized_dags() here - this will break
the tests
# The tests expect DAGs to be fully loaded here via setUpClass method
below
+ def setup_method(self):
+ self.clean_db()
+
+ def teardown_method(self):
+ if self.scheduler_job and self.scheduler_job.processor_agent:
+ self.scheduler_job.processor_agent.end()
+ self.scheduler_job = None
+ self.clean_db()
Review comment:
I had error while trying to delete DagModel in a previous push but I can
see now that here is not the problem so, I will revert it
##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -495,45 +439,24 @@ def test_find_executable_task_instances_pool(self):
assert tis[3].key in res_keys
session.rollback()
- def test_find_executable_task_instances_order_execution_date(self):
+ def test_find_executable_task_instances_order_execution_date(self,
dag_maker):
dag_id_1 =
'SchedulerJobTest.test_find_executable_task_instances_order_execution_date-a'
dag_id_2 =
'SchedulerJobTest.test_find_executable_task_instances_order_execution_date-b'
task_id = 'task-a'
- dag_1 = DAG(dag_id=dag_id_1, start_date=DEFAULT_DATE,
max_active_tasks=16)
- dag_2 = DAG(dag_id=dag_id_2, start_date=DEFAULT_DATE,
max_active_tasks=16)
- dag1_task = DummyOperator(dag=dag_1, task_id=task_id)
- dag2_task = DummyOperator(dag=dag_2, task_id=task_id)
+ with dag_maker(dag_id=dag_id_1, max_active_tasks=16) as dag_1:
+ dag1_task = DummyOperator(task_id=task_id)
+ dr1 = dag_maker.create_dagrun(execution_date=DEFAULT_DATE +
timedelta(hours=1))
Review comment:
It's how the dagrun was created before this change,. I decided not to
change it. Look at the deleted line 528
--
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]