You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/11/27 20:33:19 UTC
[GitHub] [airflow] XD-DENG opened a new pull request #12667: Fix test in PR 12663
XD-DENG opened a new pull request #12667:
URL: https://github.com/apache/airflow/pull/12667
The order of the two TI keys in `test_process_task_instances_depends_on_past()` (https://github.com/apache/airflow/pull/12663) is not guaranteed,
in such a case, directly assert two lists (both with two elements) will cause 'random' failure
This PR addresses this issue.
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] github-actions[bot] commented on pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12667:
URL: https://github.com/apache/airflow/pull/12667#issuecomment-734984204
The PR needs to run all tests because it modifies core of Airflow! Please rebase it to latest master or ask committer to re-run it!
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] XD-DENG commented on a change in pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
XD-DENG commented on a change in pull request #12667:
URL: https://github.com/apache/airflow/pull/12667#discussion_r531793047
##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -567,13 +567,15 @@ def test_process_task_instances_depends_on_past(self, state, start_date, end_dat
ti.start_date = start_date
ti.end_date = end_date
- ti_to_schedule = []
+ ti_to_schedule = Mock()
scheduler_job._process_task_instances(dag, task_instances_list=ti_to_schedule)
- assert ti_to_schedule == [
- (dag.dag_id, dag_task1.task_id, DEFAULT_DATE, TRY_NUMBER),
- (dag.dag_id, dag_task2.task_id, DEFAULT_DATE, TRY_NUMBER),
- ]
+ ti_to_schedule.append.assert_called_with(
Review comment:
Makes sense, and the length can be asserted too in this way. Why not.
Re-pushed.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] XD-DENG commented on pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
XD-DENG commented on pull request #12667:
URL: https://github.com/apache/airflow/pull/12667#issuecomment-734984673
Force-pushed (without further change) to trigger full test. Just be on the safe side ;-)
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on a change in pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #12667:
URL: https://github.com/apache/airflow/pull/12667#discussion_r531790955
##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -567,13 +567,15 @@ def test_process_task_instances_depends_on_past(self, state, start_date, end_dat
ti.start_date = start_date
ti.end_date = end_date
- ti_to_schedule = []
+ ti_to_schedule = Mock()
scheduler_job._process_task_instances(dag, task_instances_list=ti_to_schedule)
- assert ti_to_schedule == [
- (dag.dag_id, dag_task1.task_id, DEFAULT_DATE, TRY_NUMBER),
- (dag.dag_id, dag_task2.task_id, DEFAULT_DATE, TRY_NUMBER),
- ]
+ ti_to_schedule.append.assert_called_with(
Review comment:
Maybe just make the list sorted:
```
assert sorted([(dag.dag_id, dag_task1.task_id, DEFAULT_DATE, TRY_NUMBER), (dag.dag_id, dag_task2.task_id, DEFAULT_DATE, TRY_NUMBER),]) == sorted(ti_to_schedule)
```
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] XD-DENG commented on pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
XD-DENG commented on pull request #12667:
URL: https://github.com/apache/airflow/pull/12667#issuecomment-735003901
Three failures were observed, all are `TestUndefinedJinjaVariablesRule::test_invalid_check`. I notice it's existing in the latest a few commits in branch `v1-10-stable`. So I assume it's not related to this PR, and this PR should be good?
I believe you guys can help better judge given you are following up on `v1-10` tightly? @kaxil @potiuk .
Thanks!
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] XD-DENG commented on pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
XD-DENG commented on pull request #12667:
URL: https://github.com/apache/airflow/pull/12667#issuecomment-734983702
Feel free to drop this PR if any other better way should be favored.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] kaxil merged pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
kaxil merged pull request #12667:
URL: https://github.com/apache/airflow/pull/12667
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] XD-DENG commented on a change in pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
XD-DENG commented on a change in pull request #12667:
URL: https://github.com/apache/airflow/pull/12667#discussion_r531779764
##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -516,12 +516,12 @@ def test_process_task_instances_with_task_concurrency(
ti.start_date = start_date
ti.end_date = end_date
- ti_to_schedule = []
+ ti_to_schedule = Mock()
scheduler_job._process_task_instances(dag, task_instances_list=ti_to_schedule)
- assert ti_to_schedule == [
+ ti_to_schedule.append.assert_called_once_with(
(dag.dag_id, dag_task1.task_id, DEFAULT_DATE, TRY_NUMBER),
- ]
+ )
Review comment:
We don't "have to" make change for this line. Only for consistent testing style/method.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
kaxil commented on pull request #12667:
URL: https://github.com/apache/airflow/pull/12667#issuecomment-735005546
> Three failures were observed, all are `TestUndefinedJinjaVariablesRule::test_invalid_check`. I notice it's existing in the latest a few commits in branch `v1-10-stable`. So I assume it's not related to this PR, and this PR should be good?
>
> I believe you guys can help better judge given you are following up on `v1-10` tightly? @kaxil @potiuk .
>
> Thanks!
Yup, that's fine. Will have to fix it separately, I think that is related to Py2.7 / Py3.5
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [airflow] XD-DENG commented on a change in pull request #12667: Fix test in PR 12663
Posted by GitBox <gi...@apache.org>.
XD-DENG commented on a change in pull request #12667:
URL: https://github.com/apache/airflow/pull/12667#discussion_r531779764
##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -516,12 +516,12 @@ def test_process_task_instances_with_task_concurrency(
ti.start_date = start_date
ti.end_date = end_date
- ti_to_schedule = []
+ ti_to_schedule = Mock()
scheduler_job._process_task_instances(dag, task_instances_list=ti_to_schedule)
- assert ti_to_schedule == [
+ ti_to_schedule.append.assert_called_once_with(
(dag.dag_id, dag_task1.task_id, DEFAULT_DATE, TRY_NUMBER),
- ]
+ )
Review comment:
We don't "have to" make change for this line, given for this case we only have one TI (i.e. one element in the list).
Changing only for consistent testing style/method.
----------------------------------------------------------------
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:
users@infra.apache.org