feng-tao commented on a change in pull request #4968: [AIRFLOW-XXX] Fix race 
condition in CI test
URL: https://github.com/apache/airflow/pull/4968#discussion_r268499736
 
 

 ##########
 File path: tests/test_jobs.py
 ##########
 @@ -2553,7 +2553,7 @@ def test_dagrun_root_after_dagrun_unfinished(self):
         ti_ids = [(ti.task_id, ti.state) for ti in 
first_run.get_task_instances()]
 
         self.assertEqual(ti_ids, [('current', State.SUCCESS)])
-        self.assertEqual(first_run.state, State.SUCCESS)
+        self.assertIn(first_run.state, [State.SUCCESS, State.RUNNING])
 
 Review comment:
   I think in real scenario it will only have success state for the dagRun. The 
issue only happens in unit test as we don't wait / sleep to retrieve the result 
during CI test for speeding up the CI test effort hence we sometimes(or in some 
ORM) get the running state for the task which the dagrun state is still running.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to