This is an automated email from the ASF dual-hosted git repository.
potiuk 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 f128c840a89 fix flaky test_dags_clear (#59394)
f128c840a89 is described below
commit f128c840a894cbebfd87687465d212f81c6d530f
Author: Henry Chen <[email protected]>
AuthorDate: Sun Dec 14 15:46:43 2025 +0800
fix flaky test_dags_clear (#59394)
---
airflow-core/tests/unit/models/test_cleartasks.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/airflow-core/tests/unit/models/test_cleartasks.py
b/airflow-core/tests/unit/models/test_cleartasks.py
index 6e1f1acdf8c..4d8063f8419 100644
--- a/airflow-core/tests/unit/models/test_cleartasks.py
+++ b/airflow-core/tests/unit/models/test_cleartasks.py
@@ -643,7 +643,9 @@ class TestClearTasks:
ti.try_number += 1
session.commit()
ti.refresh_from_task(dag.get_task(ti.task_id))
- ti.run(session=session)
+ # Directly set state to SUCCESS instead of calling ti.run() to
avoid timeout
+ ti.state = State.SUCCESS
+ session.commit()
assert ti.state == State.SUCCESS
assert ti.try_number == 2
assert ti.max_tries == 1