This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-stable
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v1-10-stable by this push:
     new 65a8dbc  Fix test in PR 12663 (#12667)
65a8dbc is described below

commit 65a8dbcabdff16c20df73e84acd642c6881f5bf7
Author: Xiaodong DENG <[email protected]>
AuthorDate: Fri Nov 27 23:46:47 2020 +0100

    Fix test in PR 12663 (#12667)
    
    The order of the two TI keys in 
test_process_task_instances_depends_on_past() is not guaranteed,
    in such a case, directly assert two lists (both with two elements) will 
cause 'random' failure
    
    This PR addresses this issue.
    
    Co-authored-by: Kaxil Naik <[email protected]>
    
    Co-authored-by: Kaxil Naik <[email protected]>
---
 tests/jobs/test_scheduler_job.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/jobs/test_scheduler_job.py b/tests/jobs/test_scheduler_job.py
index ab406be..ecf8129 100644
--- a/tests/jobs/test_scheduler_job.py
+++ b/tests/jobs/test_scheduler_job.py
@@ -570,10 +570,10 @@ class SchedulerJobTest(unittest.TestCase):
         ti_to_schedule = []
         scheduler_job._process_task_instances(dag, 
task_instances_list=ti_to_schedule)
 
-        assert ti_to_schedule == [
+        assert sorted(ti_to_schedule) == sorted([
             (dag.dag_id, dag_task1.task_id, DEFAULT_DATE, TRY_NUMBER),
             (dag.dag_id, dag_task2.task_id, DEFAULT_DATE, TRY_NUMBER),
-        ]
+        ])
 
     def test_find_executable_task_instances_concurrency(self):
         dag_id = 
'SchedulerJobTest.test_find_executable_task_instances_concurrency'

Reply via email to