From e1c90e93fd67b92be280615db12d0bdb7c3b486a Mon Sep 17 00:00:00 2001 From: trevor-signal <131492920+trevor-signal@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:21:21 -0700 Subject: [PATCH] Increase test timeout in windows runner --- .github/workflows/ci.yml | 2 ++ test/test.mjs | 3 ++- .../services/AttachmentBackupManager_test.preload.ts | 2 -- ts/window.d.ts | 1 + ts/windows/main/preload_test.preload.ts | 3 +++ 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae9ff3a1a2..f54b6fa7fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -325,6 +325,8 @@ jobs: env: ARTIFACTS_DIR: artifacts/windows WORKER_COUNT: 4 + # Windows runner is very slow when writing to disk + TEST_ELECTRON_TIMEOUT: 20000 timeout-minutes: 5 - name: Run release tests diff --git a/test/test.mjs b/test/test.mjs index c657cef233..56fdb20399 100644 --- a/test/test.mjs +++ b/test/test.mjs @@ -7,7 +7,8 @@ */ mocha.setup('bdd'); -mocha.setup({ timeout: 10000 }); +// Can be overridden with TEST_ELECTRON_TIMEOUT +mocha.setup({ timeout: window.testUtilities.timeout ?? 10000 }); let themeSetting = 'light'; diff --git a/ts/test-electron/services/AttachmentBackupManager_test.preload.ts b/ts/test-electron/services/AttachmentBackupManager_test.preload.ts index 9c16314df8..6ecd5c1f71 100644 --- a/ts/test-electron/services/AttachmentBackupManager_test.preload.ts +++ b/ts/test-electron/services/AttachmentBackupManager_test.preload.ts @@ -27,7 +27,6 @@ import { encryptAttachmentV2, generateKeys, } from '../../AttachmentCrypto.node.ts'; -import { SECOND } from '../../util/durations/index.std.ts'; import { HTTPError } from '../../types/HTTPError.std.ts'; import { itemStorage } from '../../textsecure/Storage.preload.ts'; @@ -42,7 +41,6 @@ const LOCAL_ENCRYPTION_KEYS = Bytes.toBase64(generateKeys()); const ATTACHMENT_SIZE = 1476; describe('AttachmentBackupManager/JobManager', function attachmentBackupManager(this: Mocha.Suite) { - this.timeout(10 * SECOND); let backupManager: AttachmentBackupManager | undefined; let runJob: sinon.SinonSpy; let copyBackupMedia: sinon.SinonStub; diff --git a/ts/window.d.ts b/ts/window.d.ts index bb9afa81c5..76c43723a7 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -215,6 +215,7 @@ declare global { assert: typeof assert; testUtilities: { setup: MochaOptions; + timeout: number | undefined; debug: (info: unknown) => void; onTestEvent: (event: unknown) => void; initialize: () => Promise; diff --git a/ts/windows/main/preload_test.preload.ts b/ts/windows/main/preload_test.preload.ts index afee1002b0..3f3cb9e28e 100644 --- a/ts/windows/main/preload_test.preload.ts +++ b/ts/windows/main/preload_test.preload.ts @@ -81,6 +81,9 @@ let workerCount = 1; window.testUtilities = { setup, + timeout: process.env.TEST_ELECTRON_TIMEOUT + ? parseInt(process.env.TEST_ELECTRON_TIMEOUT, 10) + : undefined, onTestEvent(event: unknown) { return ipc.invoke('ci:test-electron:event', event);