From b66f1a55f35bffde65fc1d9b86403d7c00727f1d Mon Sep 17 00:00:00 2001 From: "jakub.jedlikowski" Date: Mon, 30 Sep 2024 14:05:51 +0200 Subject: [PATCH] chore: further increase long running task duration --- test/fn.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/fn.spec.ts b/test/fn.spec.ts index d0f139deb..1203fde8d 100644 --- a/test/fn.spec.ts +++ b/test/fn.spec.ts @@ -106,16 +106,17 @@ test('timeout', async () => { test('subsequent executions after timeout', async () => { const executionTimeout = 30 + const longRunningTaskDuration = executionTimeout * 10 process.env.SYNCKIT_TIMEOUT = executionTimeout.toString() const { createSyncFn } = await import('synckit') const syncFn = createSyncFn(workerCjsPath) // start an execution in worker that will definitely time out - expect(() => syncFn(1, executionTimeout * 3)).toThrow() + expect(() => syncFn(1, longRunningTaskDuration)).toThrow() // wait for timed out execution to finish inside worker - await new Promise(resolve => setTimeout(resolve, executionTimeout * 3)) + await new Promise(resolve => setTimeout(resolve, longRunningTaskDuration)) // subsequent executions should work correctly expect(syncFn(2, 1)).toBe(2)