Skip to content

Commit

Permalink
Fix test_retry_handling_job (#34326)
Browse files Browse the repository at this point in the history
Needed to resync dag to db so that scheduler schedules it with num_runs=1

Co-authored-by: daniel.dylag <[email protected]>
(cherry picked from commit 1b26cc0)
  • Loading branch information
Bisk1 authored and ephraimbuddy committed Oct 30, 2023
1 parent 7885869 commit 719de69
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/jobs/test_scheduler_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -3039,7 +3039,6 @@ def run_with_error(ti, ignore_ti_state=False):
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
Expand All @@ -3048,9 +3047,11 @@ def test_retry_handling_job(self):
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()
Expand Down

0 comments on commit 719de69

Please sign in to comment.