huozhanfeng commented on a change in pull request #16768:
URL: https://github.com/apache/airflow/pull/16768#discussion_r663636682



##########
File path: airflow/models/taskinstance.py
##########
@@ -1495,8 +1495,7 @@ def handle_failure(
             except Exception:
                 self.log.exception('Failed to send email to: %s', task.email)
 
-        if not test_mode:
-            session.merge(self)
+        session.merge(self)

Review comment:
       @uranusjr Find the one.  Looks like it's related to the airflow test 
command. In the lasted UT, UT will raise `IndexError: list index out of range` 
with the code block `assert tis[0].hostname == "test_hostname"` if remove this 
change.  
   
   I wonder whether it is reasonable to mix UT and test commands together here 
by using a test_mode variable because the test command doesn't want to save the 
state into DB/session but UT should save the state into DB/session. Do you have 
any idea about it?
   <pre>
   commit aa01fab4906df3175e5e6589ec0095a5586279db
   Author: Maxime Beauchemin <maxime.beauche...@apache.org>
   Date:   Mon Jan 12 21:54:40 2015 +0000
   
       Improving the test command line subcommand
   
   <pre>




-- 
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-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to