make test_list_jobs_populated deterministic
Continuous Integration / backend-tests (push) Successful in 40s
Continuous Integration / frontend-check (push) Successful in 14s
Continuous Integration / e2e-tests (push) Successful in 5m12s

This commit is contained in:
2026-05-05 18:54:41 -04:00
parent 1ef2c194db
commit c3457308ba
+6 -3
View File
@@ -1,4 +1,4 @@
from datetime import datetime, timezone
from datetime import datetime, timedelta, timezone
import pytest
@@ -17,19 +17,22 @@ def test_list_jobs_empty(client):
def test_list_jobs_populated(client, db_session):
"""Tests listing jobs with pagination and latest_log inclusion."""
now = datetime.now(timezone.utc)
job1 = models.Job(
job_type="SCAN",
status="COMPLETED",
progress=100.0,
current_task="Done",
started_at=datetime.now(timezone.utc),
completed_at=datetime.now(timezone.utc),
started_at=now - timedelta(seconds=2),
completed_at=now - timedelta(seconds=1),
created_at=now - timedelta(seconds=2),
)
job2 = models.Job(
job_type="BACKUP",
status="RUNNING",
progress=50.0,
current_task="Writing archive",
created_at=now,
)
db_session.add_all([job1, job2])
db_session.flush()