pankajastro commented on code in PR #32000:
URL: https://github.com/apache/airflow/pull/32000#discussion_r1244252381


##########
airflow/models/dag.py:
##########
@@ -2645,6 +2645,13 @@ def test(
         :param variable_file_path: file path to a variable file in either yaml 
or json
         :param session: database connection (optional)
         """
+        # If DAG is paused, unpaused it to avoid test being stuck in case of 
deferrable operator or retry.
+        if self.is_paused:
+            self.log.info("The DAG %s is paused. Unpausing it.", self.dag_id)
+            session.query(DagModel).filter(DagModel.dag_id == 
self.dag_id).update(
+                {DagModel.is_paused: False, DagModel.is_active: True}

Review Comment:
   right, I do not need to update `is_active` to pause/unpause dag. Thank you!



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