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 2023/01/05 06:45:12 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #28724: Use dagrun instead of DagFileProcessor in backfill_job test

uranusjr commented on code in PR #28724:
URL: https://github.com/apache/airflow/pull/28724#discussion_r1062153339


##########
tests/jobs/test_backfill_job.py:
##########
@@ -147,31 +147,22 @@ def test_dag_run_with_finished_tasks_set_to_success(self, dag_maker):
 
         assert State.SUCCESS == dag_run.state
 
-    @pytest.mark.xfail(condition=True, reason="This test is flaky")
     @pytest.mark.backend("postgres", "mysql")
     def test_trigger_controller_dag(self):
         dag = self.dagbag.get_dag("example_trigger_controller_dag")
         target_dag = self.dagbag.get_dag("example_trigger_target_dag")
         target_dag.sync_to_db()
 
-        # dag_file_processor = DagFileProcessor(dag_ids=[], log=Mock())
-        task_instances_list = []
-        # task_instances_list = dag_file_processor._process_task_instances(
-        #    target_dag,
-        #    dag_runs=DagRun.find(dag_id='example_trigger_target_dag')
-        # )
-        assert not task_instances_list
+        target_dag_run = target_dag.get_last_dagrun()

Review Comment:
   Instead of relying on `get_last_dagrun()` (which can have bugs), it could be better to use SQLAlchemy directly here. There is a `session` pytest fixture you can use for this.



-- 
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