SamWheating commented on a change in pull request #22410:
URL: https://github.com/apache/airflow/pull/22410#discussion_r836663310
##########
File path: tests/api/common/test_mark_tasks.py
##########
@@ -655,15 +670,20 @@ def test_set_state_without_commit(self):
will_be_altered = set_dag_run_state_to_failed(dag=self.dag1,
run_id=dr.run_id, commit=False)
- # Only the running task should be altered.
- expected = self._get_num_tasks_with_starting_state(State.RUNNING,
inclusion=True)
+ # Only the non-completed tasks should be altered.
+ expected = len(self.INITIAL_TASK_STATES.values()) -
self._get_num_tasks_with_starting_state(
+ State.SUCCESS, inclusion=True
+ )
+ expected = expected -
self._get_num_tasks_with_starting_state(State.FAILED, inclusion=True)
+ expected = expected -
self._get_num_tasks_with_starting_state(State.SKIPPED, inclusion=True)
+ expected = expected -
self._get_num_tasks_with_starting_state(State.UPSTREAM_FAILED, inclusion=True)
assert len(will_be_altered) == expected
self._verify_dag_run_state(self.dag1, date, State.RUNNING)
self._verify_task_instance_states_remain_default(dr)
will_be_altered = set_dag_run_state_to_success(dag=self.dag1,
run_id=dr.run_id, commit=False)
- # All except the SUCCESS task should be altered.
+ # Only the non-completed tasks should be altered.
Review comment:
I don't think that this comment should be changed as a part of this PR -
the functionality of `set_dag_run_state_to_success` is unchanged.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]