This is an automated email from the ASF dual-hosted git repository.
taragolis 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 1b26cc05ff Fix test_retry_handling_job (#34326)
1b26cc05ff is described below
commit 1b26cc05ff553685c50a15f56a954e465ed43478
Author: Daniel DylÄ…g <[email protected]>
AuthorDate: Thu Sep 14 12:03:46 2023 +0200
Fix test_retry_handling_job (#34326)
Needed to resync dag to db so that scheduler schedules it with num_runs=1
Co-authored-by: daniel.dylag <[email protected]>
---
tests/jobs/test_scheduler_job.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/jobs/test_scheduler_job.py b/tests/jobs/test_scheduler_job.py
index 5e602c8f10..b2bbe34457 100644
--- a/tests/jobs/test_scheduler_job.py
+++ b/tests/jobs/test_scheduler_job.py
@@ -3037,7 +3037,6 @@ class TestSchedulerJob:
ti.refresh_from_db()
assert ti.state == State.SUCCESS
- @pytest.mark.skip(reason="This test needs fixing. It's very wrong now and
always fails")
def test_retry_handling_job(self):
"""
Integration test of the scheduler not accidentally resetting
@@ -3046,9 +3045,11 @@ class TestSchedulerJob:
dag = self.dagbag.get_dag("test_retry_handling_job")
dag_task1 = dag.get_task("test_retry_handling_op")
dag.clear()
+ dag.sync_to_db()
- scheduler_job = Job(jobe_type=SchedulerJobRunner.job_type, heartrate=0)
- self.job_runner = SchedulerJobRunner(job=scheduler_job,
dag_id=dag.dag_id, num_runs=1)
+ scheduler_job = Job(job_type=SchedulerJobRunner.job_type, heartrate=0)
+ self.job_runner = SchedulerJobRunner(job=scheduler_job, num_runs=1)
+ self.job_runner.processor_agent = mock.MagicMock()
run_job(scheduler_job, execute_callable=self.job_runner._execute)
session = settings.Session()