diff --git a/tests/worker/jobs/step_run_mock_job.py b/tests/worker/jobs/step_run_mock_job.py index 7089c370..c95b631b 100644 --- a/tests/worker/jobs/step_run_mock_job.py +++ b/tests/worker/jobs/step_run_mock_job.py @@ -13,20 +13,21 @@ def __init__(self, run_id, realtime, timescale, external_clock, start_datetime, super().__init__() self.checkout_run(run_id) StepRunBase.__init__(self, run_id, realtime, timescale, external_clock, start_datetime, end_datetime, skip_site_init=True, skip_stop_db_writes=True) - self.first_step_warmup = True - self.simulation_step_duration = 1 - self.run.sim_time = self.start_datetime + self.options.warmup_is_first_step = True + self.options.timestep_duration = timedelta(minutes=1) + self.run.sim_time = self.options.start_datetime def step(self): sleep(self.simulation_step_duration) self.set_run_time(self.run.sim_time + self.time_per_step()) - def time_per_step(self) -> timedelta: - return timedelta(seconds=60) - def get_sim_time(self) -> datetime.datetime: return self.run.sim_time @message def set_simulation_step_duration(self, simulation_step_duration): - self.simulation_step_duration = simulation_step_duration + self.options.timestep_duration = timedelta(minutes=simulation_step_duration) + + @message + def advance(self): + self.run.sim_time = self.run.sim_time + 1