Skip to content

Commit

Permalink
Fix test in PR 12663
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
XD-DENG and kaxil committed Nov 27, 2020
1 parent 2a7944d commit edb79a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/jobs/test_scheduler_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,10 @@ def test_process_task_instances_depends_on_past(self, state, start_date, end_dat
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'
Expand Down

0 comments on commit edb79a3

Please sign in to comment.