mis98zb opened a new pull request, #30965:
URL: https://github.com/apache/airflow/pull/30965

   The DAG.test() code is as below:
   ```python
           # Instead of starting a scheduler, we run the minimal loop possible 
to check
           # for task readiness and dependency management. This is notably 
faster
           # than creating a BackfillJob and allows us to surface logs to the 
user
           while dr.state == State.RUNNING:
               schedulable_tis, _ = dr.update_state(session=session)
               for ti in schedulable_tis:
                   add_logger_if_needed(ti)
                   ti.task = tasks[ti.task_id]
                   _run_task(ti, session=session)
           if conn_file_path or variable_file_path:
               # Remove the local variables we have added to the 
secrets_backend_list
               secrets_backend_list.pop(0)
   ```
   When exception occurred in a task, the exception will be raised from 
`_run_task(ti, session=session)`.
   In the loop, there is no try...except, so the function is terminated 
immediately.
   This is the reason why DAG's on_failure_callback cannot be invoked during 
testing.
   
   


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

Reply via email to