-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail dag test if defer without triggerer #34619
Fail dag test if defer without triggerer #34619
Conversation
airflow/models/dag.py
Outdated
@@ -3957,7 +3979,16 @@ def get_current_dag(cls) -> DAG | None: | |||
return None | |||
|
|||
|
|||
def _run_task(ti: TaskInstance, session): | |||
def _triggerer_is_healthy(): | |||
from airflow.api.common.airflow_health import get_airflow_health |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure. we do have a plan to integrate triggerer functionality into test
directly right? Because this would only be good as a temporary measure; if we want to keep this function long term I’d want some refactoring instead of importing api
from models
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But in either case this really should call TriggererJobRunner.most_recent_job()
directly instead of going through the additional abstraction in api
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure. we do have a plan to integrate triggerer functionality into test directly right? Because this would only be good as a temporary measure; if we want to keep this function long term I’d want some refactoring instead of importing api from models
Plan might be overstating it. It's an idea. But, there's no guarantee it happens. I'm simply being pragmatic, doing the easy thing to make user's life nicer, by failing when otherwise they might just wait forever.
But in either case this really should call TriggererJobRunner.most_recent_job() directly instead of going through the additional abstraction in api.
Yeah that sounds good. I wasn't sure exactly what was best.
5dad289
to
ef577e7
Compare
alright, sir, PTALWYGAC |
If user runs dag.test and task defers and no triggerer is running, we should fail so user does not sit there waiting forever. --------- Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com> (cherry picked from commit e81bb48)
If user runs dag.test and task defers and no triggerer is running, we should fail so user does not sit there waiting forever.