This is an automated email from the ASF dual-hosted git repository.
onikolas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new b72df7bd487 Increase scheduler loop sleep in dag.test for executors
(#58739)
b72df7bd487 is described below
commit b72df7bd487ed836849bc5dd585e8082768d73fd
Author: Niko Oliveira <[email protected]>
AuthorDate: Wed Nov 26 11:53:00 2025 -0800
Increase scheduler loop sleep in dag.test for executors (#58739)
If we are using a real executor, those often make some requests or describe
calls to an external service to track the progress of the running tasks.
Doing that every 1s is way too aggressive, especially given that these are
just tests.
---
task-sdk/src/airflow/sdk/definitions/dag.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/task-sdk/src/airflow/sdk/definitions/dag.py
b/task-sdk/src/airflow/sdk/definitions/dag.py
index 3abd205fc3b..7e410858cb4 100644
--- a/task-sdk/src/airflow/sdk/definitions/dag.py
+++ b/task-sdk/src/airflow/sdk/definitions/dag.py
@@ -1316,7 +1316,13 @@ class DAG:
ids_unrunnable = {x for x in all_tis if x.state not in
FINISHED_STATES} - scheduled_tis
if not scheduled_tis and ids_unrunnable:
log.warning("No tasks to run. unrunnable tasks: %s",
ids_unrunnable)
- time.sleep(1)
+ if use_executor:
+ # If we are using a real executor, those often make
some request or describe call to
+ # an external service to track the progress of the
running tasks. Doing that every 1s
+ # is way too aggressive, especially given that these
are just tests.
+ time.sleep(30)
+ else:
+ time.sleep(1)
for ti in scheduled_tis:
task = self.task_dict[ti.task_id]