Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: give backup.db restore cases a 60s load-tolerant timeout (#12453)

[._.]/ Adam Eivy0e5e8e164766
diff --git a/server/services/backup.db.test.js b/server/services/backup.db.test.js
index 53afb40319..0f70f42d76 100644
--- a/server/services/backup.db.test.js
+++ b/server/services/backup.db.test.js
@@ -54,6 +54,11 @@ const owned = ownTestBodies(vitestIt);
const it = owned.it;
let fixtureSetup;
const FIXTURE_SETUP_BUDGET_MS = 60000;
+// Every case replays a real pg_dump into a schema reset plus ordered migrations
+// (about 11 s each when idle; 101 s for the file), so the DB config default of
+// 15 s has under 2x headroom and times out when pregate runs share the host
+// (#12453). Matches the fixture hook budget; a real hang still fails.
+const RESTORE_CASE_TIMEOUT_MS = 60000;
const feedSequenceValues = async () => Object.fromEntries((await query(
'SELECT sequencename, last_value::text AS v FROM pg_sequences WHERE sequencename = ANY($1::text[])',
@@ -126,7 +131,7 @@ function expectRestoreOk(result, dryRun) {
expect(result.dryRun).toBe(dryRun);
}
-describe.skipIf(!ready)('restore older database schema', () => {
+describe.skipIf(!ready)('restore older database schema', { timeout: RESTORE_CASE_TIMEOUT_MS }, () => {
let appliedBefore;
let feedBefore;
const folder = { id: folderId, name: 'Recovered folder' };