From f4b6b8941a30a20615cc87627a0663ff6d03c932 Mon Sep 17 00:00:00 2001 From: Paul Nothaft Date: Mon, 22 Jun 2026 21:32:12 +0200 Subject: [PATCH] fix(test): raise bootCrmDb beforeAll timeout on slideshow suites MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI runners hit Jest's default 5s `beforeAll` timeout on slideshowPublic.test.js's bootCrmDb call (~5.4s observed vs ~2s local — runner-to-runner I/O variance, not a regression). Same hook shape on slideshowAdmin.test.js is one slow runner away from the same failure. Raise both to 30s so this stops blocking unrelated PRs branched off beta. Adjacent to #654 — not strictly part of that fix but the only blocker between #656 and a green CI right now. --- backend/__tests__/routes/slideshowAdmin.test.js | 5 ++++- backend/__tests__/routes/slideshowPublic.test.js | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/__tests__/routes/slideshowAdmin.test.js b/backend/__tests__/routes/slideshowAdmin.test.js index 45c08fbe..ca277004 100644 --- a/backend/__tests__/routes/slideshowAdmin.test.js +++ b/backend/__tests__/routes/slideshowAdmin.test.js @@ -57,6 +57,9 @@ async function insertEvent(db, adminId, over = {}) { describe('admin Live Slideshow endpoints', () => { let db; let cleanup; let app; let adminId; let token; + // Match slideshowPublic.test.js — bootCrmDb's full migration run intermittently + // exceeds Jest's default 5s `beforeAll` timeout on slower CI runners; raise + // it so this doesn't block PRs. beforeAll(async () => { ({ db, cleanup } = await bootCrmDb()); ({ adminId } = await seedMinimal(db)); @@ -72,7 +75,7 @@ describe('admin Live Slideshow endpoints', () => { app.use((err, req, res, next) => { res.status(err.statusCode || err.status || 500).json({ error: err.message, code: err.code }); }); - }); + }, 30000); afterAll(async () => { await cleanup(); }); diff --git a/backend/__tests__/routes/slideshowPublic.test.js b/backend/__tests__/routes/slideshowPublic.test.js index 64e1d185..5bb6633a 100644 --- a/backend/__tests__/routes/slideshowPublic.test.js +++ b/backend/__tests__/routes/slideshowPublic.test.js @@ -67,6 +67,11 @@ async function insertEvent(db, over = {}) { describe('public Live Slideshow routes', () => { let db; let cleanup; let app; + // bootCrmDb runs the full migration set against a fresh SQLite file, which + // takes <2s locally but has been observed to exceed Jest's default 5s + // `beforeAll` timeout on slower GitHub Actions runners (~5.4s — runner-to- + // runner I/O variance). Raise the hook timeout so this doesn't intermittently + // block PRs on CI; doesn't affect happy-path local runs. beforeAll(async () => { ({ db, cleanup } = await bootCrmDb()); await seedMinimal(db); @@ -81,7 +86,7 @@ describe('public Live Slideshow routes', () => { app.use((err, req, res, next) => { res.status(err.statusCode || err.status || 500).json({ error: err.message, code: err.code }); }); - }); + }, 30000); afterAll(async () => { await cleanup(); });