From a306a8617a0e7ada84e443ff8b6538eb07e8c81d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 23 Oct 2026 20:58:30 +0200 Subject: [PATCH] test(e2e): give a queued restore longer than one lane deferral The restore shares the heavy lane with the backup pass, and a restore that finds the lane taken goes back to the queue for 60 seconds. The journey waited exactly 60 seconds for it. On a loaded machine the pass the journey had just started was still finishing its tail when the restore came in, so the restore was deferred and started one second after the wait ran out. The wait now holds one deferral and a second yield, and the test timeout makes room for it. --- e2e/backup-restore-journey.spec.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/e2e/backup-restore-journey.spec.ts b/e2e/backup-restore-journey.spec.ts index a5193ca58..ef905aa70 100644 --- a/e2e/backup-restore-journey.spec.ts +++ b/e2e/backup-restore-journey.spec.ts @@ -91,8 +91,20 @@ test.describe.configure({ mode: "serial" }); * The pass backs up every account in the database, the restore rewrites a * dozen tables in one transaction, and the archive runs Argon2id at the OWASP * cost. None of that fits the suite's 30-second default on a loaded runner. + * On top of that, a test must hold the restore wait below in full. */ -test.setTimeout(180_000); +test.setTimeout(240_000); + +/** + * How long a queued restore may take to finish. The restore shares the heavy + * lane with the backup pass, and a restore that finds the lane taken goes + * back to the queue for `LANE_DEFER_SECONDS` (60 s, `src/lib/jobs/heavy-lane.ts`). + * The pass this journey starts can still be finishing when the restore is + * asked for: on a loaded machine its tail ran 15 s, the restore was put back + * by 60, and a 60-second wait ran out one second before it started. The + * budget holds one deferral and a second yield with room to run. + */ +const RESTORE_BUDGET_MS = 135_000; /** Long enough to clear the export card's own 12-character minimum. */ const ARCHIVE_PASSPHRASE = "e2e-backup-journey-passphrase"; @@ -339,7 +351,7 @@ async function awaitRestore(page: Page, response: Response): Promise { ? `failed: ${body.data.failure?.code ?? "unknown"}` : body.data?.status; }, - { timeout: 60_000, intervals: [250, 500, 1_000] }, + { timeout: RESTORE_BUDGET_MS, intervals: [250, 500, 1_000] }, ) .toBe("succeeded"); }