فهرست منبع

Tests: Git backup wipe also removes open runs

- _wipe deleted runs with a plain delete, which _hide_open_runs
  limits to finished runs: the open run stayed behind and tied
  with its restored copy on started_at
- the test took the last run by started_at, so under xdist it
  could pick the leftover and see 'printing' instead of
  'cancelled'
- the wipe now deletes with include_open_runs
maziggy 2 روز پیش
والد
کامیت
fb441acc2f
1فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 6 2
      backend/tests/integration/test_git_backup_runs.py

+ 6 - 2
backend/tests/integration/test_git_backup_runs.py

@@ -61,9 +61,13 @@ async def _all_runs(db) -> list[PrintLogEntry]:
 
 
 async def _wipe(db) -> None:
-    """A rebuilt instance: no archives, prints or merges."""
+    """A rebuilt instance: no archives, prints or merges.
+
+    Open runs too: a plain delete of runs leaves them out (_hide_open_runs),
+    and one left behind ties with its restored copy on started_at.
+    """
     for model in (PrintLogEntry, ArchiveAlias, PrintArchive):
-        await db.execute(delete(model))
+        await db.execute(delete(model).execution_options(**{INCLUDE_OPEN_RUNS: True}))
     await db.commit()