Skip to content

Commit beb55ae

Browse files
committed
Fix tests
1 parent 94fe7a7 commit beb55ae

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/dstack/_internal/server/testing/common.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

src/tests/_internal/server/background/pipeline_tasks/test_runs/test_pipeline.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)