This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-7-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit e678fe160c97c976dbec8fe0e2d6ef296a1ac751
Author: Daniel DylÄ…g <bi...@users.noreply.github.com>
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 <danieldylag1...@gmail.com>
    (cherry picked from commit 1b26cc05ff553685c50a15f56a954e465ed43478)
---
 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 57a02e782a..c1366449dd 100644
--- a/tests/jobs/test_scheduler_job.py
+++ b/tests/jobs/test_scheduler_job.py
@@ -3039,7 +3039,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
@@ -3048,9 +3047,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()

Reply via email to