[AIRFLOW-209] Add scheduler tests and improve lineage handling#1568
Merged
asfgit merged 1 commit intoapache:masterfrom Jun 3, 2016
Merged
[AIRFLOW-209] Add scheduler tests and improve lineage handling#1568asfgit merged 1 commit intoapache:masterfrom
asfgit merged 1 commit intoapache:masterfrom
Conversation
airflow/models.py
Outdated
Contributor
There was a problem hiding this comment.
Wonder about this logic. Is it possible to get an AirflowException for another reason, and erroneously set the state to REMOVED?
Contributor
Author
There was a problem hiding this comment.
Not really. Removed is set when the task
Does not exist in the DAG. This exception is thrown when the task does not exist in task dictionary of the DAG.
Member
There was a problem hiding this comment.
So is the guard (if self.state is not State.RUNING) against it running to protect against this situation:
- Task starts running
- While task is running, DAG is modified and task is removed
- We don't want to interrupt the running task, that's what this guard is for
If so do you mind just commenting the logic to clarify?
Contributor
|
LGTM |
This patch adds schedule_dag and process_dag unittests. It also fixes some minor bugs that were caught by these tests. Some small changes for readability.
ff3ce4f to
fb5a3b3
Compare
| queue.put.assert_not_called() | ||
|
|
||
| def test_scheduler_do_not_schedule_removed_task(self): | ||
| dag = DAG( |
Member
There was a problem hiding this comment.
The DAG creation code is very repetitive and I think it will be useful for future tests. Maybe you could refactor it into a helper function?
Member
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dear Airflow Maintainers,
Please accept this PR that addresses the following issues:
Reminders for contributors: