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 28b89563a19 Fix flaky test_next_dagrun_after_fake_scheduled_previous
(#59035)
28b89563a19 is described below
commit 28b89563a1963565b21985a7ebf9998ea5279966
Author: Anshu Singh <[email protected]>
AuthorDate: Sat Dec 6 13:46:53 2025 +0530
Fix flaky test_next_dagrun_after_fake_scheduled_previous (#59035)
---
airflow-core/tests/unit/models/test_dag.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/airflow-core/tests/unit/models/test_dag.py
b/airflow-core/tests/unit/models/test_dag.py
index 7108a968ebb..ece2b456419 100644
--- a/airflow-core/tests/unit/models/test_dag.py
+++ b/airflow-core/tests/unit/models/test_dag.py
@@ -959,6 +959,7 @@ class TestDag:
dag_run.handle_dag_callback(dag=dag, success=False)
dag_run.handle_dag_callback(dag=dag, success=True)
+ @time_machine.travel(timezone.datetime(2025, 11, 11))
@pytest.mark.parametrize(("catchup", "expected_next_dagrun"), [(True,
DEFAULT_DATE), (False, None)])
def test_next_dagrun_after_fake_scheduled_previous(
self, catchup, expected_next_dagrun, testing_dag_bundle
@@ -994,11 +995,9 @@ class TestDag:
model = session.get(DagModel, dag.dag_id)
if expected_next_dagrun is None:
- # For catchup=False, next_dagrun should be based on the current
date
- current_time = timezone.utcnow()
# Verify it's not using the old default date
- assert model.next_dagrun.year == current_time.year
- assert model.next_dagrun.month == current_time.month
+ assert model.next_dagrun.year == 2025
+ assert model.next_dagrun.month == 11
# Verify next_dagrun_create_after is scheduled after next_dagrun
assert model.next_dagrun_create_after > model.next_dagrun
else: