File tree Expand file tree Collapse file tree
dstack/_internal/server/testing
tests/_internal/server/background/pipeline_tasks/test_runs Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -322,6 +322,7 @@ async def create_run(
322322 deployment_num : int = 0 ,
323323 resubmission_attempt : int = 0 ,
324324 next_triggered_at : Optional [datetime ] = None ,
325+ last_processed_at : Optional [datetime ] = None ,
325326) -> RunModel :
326327 if run_name is None :
327328 run_name = "test-run"
@@ -332,6 +333,8 @@ async def create_run(
332333 )
333334 if run_id is None :
334335 run_id = uuid .uuid4 ()
336+ if last_processed_at is None :
337+ last_processed_at = submitted_at
335338 run = RunModel (
336339 id = run_id ,
337340 deleted = deleted ,
@@ -344,7 +347,7 @@ async def create_run(
344347 status = status ,
345348 termination_reason = termination_reason ,
346349 run_spec = run_spec .json (),
347- last_processed_at = submitted_at ,
350+ last_processed_at = last_processed_at ,
348351 jobs = [],
349352 priority = priority ,
350353 deployment_num = deployment_num ,
Original file line number Diff line number Diff line change @@ -102,8 +102,9 @@ async def test_fetch_selects_eligible_runs_and_sets_lock_fields(
102102 repo = repo ,
103103 user = user ,
104104 run_name = "recent" ,
105- status = RunStatus .SUBMITTED ,
105+ status = RunStatus .RUNNING ,
106106 submitted_at = now ,
107+ last_processed_at = now + dt .timedelta (seconds = 10 ),
107108 )
108109
109110 items = await fetcher .fetch (limit = 10 )
You can’t perform that action at this time.
0 commit comments