From ed9844b2ec79c7f1bbc45c4a47897967bf1a9e52 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 24 Apr 2025 17:24:58 +0100 Subject: [PATCH] Merge pull request #25088 from overleaf/bg-increase-verify-blob-timeout increase script timeout to avoid flaky tests in backupVerifier GitOrigin-RevId: 4a52178b0e03ca9a69f82f7ddfe866ce689592b7 --- .../test/acceptance/js/api/backupVerifier.test.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/services/history-v1/test/acceptance/js/api/backupVerifier.test.mjs b/services/history-v1/test/acceptance/js/api/backupVerifier.test.mjs index 1fe09f4b1c..2b4001a9f0 100644 --- a/services/history-v1/test/acceptance/js/api/backupVerifier.test.mjs +++ b/services/history-v1/test/acceptance/js/api/backupVerifier.test.mjs @@ -30,6 +30,9 @@ import { historyStore } from '../../../../storage/lib/history_store.js' * @typedef {import("overleaf-editor-core").Blob} Blob */ +// Timeout for script execution, increased to avoid flaky tests +const SCRIPT_TIMEOUT = 15_000 + async function verifyProjectScript(historyId, expectFail = true) { try { const result = await promisify(execFile)( @@ -37,7 +40,7 @@ async function verifyProjectScript(historyId, expectFail = true) { ['storage/scripts/verify_project.mjs', `--historyId=${historyId}`], { encoding: 'utf-8', - timeout: 5_000, + timeout: SCRIPT_TIMEOUT, env: { ...process.env, LOG_LEVEL: 'warn', @@ -82,7 +85,7 @@ async function verifyBlobScript(historyId, hash, expectFail = true) { ], { encoding: 'utf-8', - timeout: 5_000, + timeout: SCRIPT_TIMEOUT, env: { ...process.env, LOG_LEVEL: 'warn', @@ -208,6 +211,7 @@ async function checkDEKExists(historyId) { } describe('backupVerifier', function () { + this.timeout(5_000 + SCRIPT_TIMEOUT) // allow time for external scripts to run const historyIdPostgres = '42' const historyIdMongo = '000000000000000000000042' let blobHashPG, blobHashMongo, blobPathPG