This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi 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 1c1c391279a Fix Failing scheduler test (#45806)
1c1c391279a is described below
commit 1c1c391279acde7a14b58600aa9214900683cb5a
Author: Ephraim Anierobi <[email protected]>
AuthorDate: Mon Jan 20 23:56:17 2025 +0100
Fix Failing scheduler test (#45806)
This test fails consistently in local dev.
The bundle referenced in the test is not in the DB and also dag_version
is being removed in dag_maker.create_dagrun kwargs. This PR fixes the issues
---
tests/jobs/test_scheduler_job.py | 1 +
tests_common/pytest_plugin.py | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/jobs/test_scheduler_job.py b/tests/jobs/test_scheduler_job.py
index b370f4f8555..df823d89c16 100644
--- a/tests/jobs/test_scheduler_job.py
+++ b/tests/jobs/test_scheduler_job.py
@@ -4349,6 +4349,7 @@ class TestSchedulerJob:
]
assert dagrun_logical_dates == expected_logical_dates
+ @pytest.mark.usefixtures("testing_dag_bundle")
def test_do_schedule_max_active_runs_and_manual_trigger(self, dag_maker,
mock_executors):
"""
Make sure that when a DAG is already at max_active_runs, that manually
triggered
diff --git a/tests_common/pytest_plugin.py b/tests_common/pytest_plugin.py
index dab785c5b77..413c83eb51b 100644
--- a/tests_common/pytest_plugin.py
+++ b/tests_common/pytest_plugin.py
@@ -927,8 +927,8 @@ def dag_maker(request) -> Generator[DagMaker, None, None]:
if AIRFLOW_V_3_0_PLUS:
kwargs.setdefault("triggered_by", DagRunTriggeredByType.TEST)
kwargs["logical_date"] = logical_date
- kwargs["dag_version"] = None
else:
+ kwargs.pop("dag_version", None)
kwargs.pop("triggered_by", None)
kwargs["execution_date"] = logical_date