From eb3c07e6ccddb0980837e2777598027bd8da92f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 8 Jul 2025 16:35:45 +0200 Subject: [PATCH] test: adjust elapsed max time at pool destroy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- SECURITY.md | 3 ++- src/pools/abstract-pool.ts | 2 +- tests/pools/abstract-pool.test.mjs | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index d42dfb7aa..31e1bbe2a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,7 +6,8 @@ Security matrix, currently there are no security vulnerabilities. | Version | Supported | | ------- | ------------------ | -| 4.x.x | :white_check_mark: | +| 5.x.x | :white_check_mark: | +| 4.x.x | :x: | | 3.x.x | :x: | | 2.x.x | :x: | | 1.x.x | :x: | diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 298bc2a28..f69921b5c 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -2180,7 +2180,7 @@ export abstract class AbstractPool< private async sendKillMessageToWorker ( workerNodeKey: number, - timeout = 2000 + timeout = 1000 ): Promise { let timeoutHandle: NodeJS.Timeout | undefined let killMessageListener: diff --git a/tests/pools/abstract-pool.test.mjs b/tests/pools/abstract-pool.test.mjs index 452d5b55d..1e40178c0 100644 --- a/tests/pools/abstract-pool.test.mjs +++ b/tests/pools/abstract-pool.test.mjs @@ -1447,7 +1447,10 @@ describe('Abstract pool test suite', () => { const elapsedTime = performance.now() - startTime expect(tasksFinished).toBeLessThanOrEqual(numberOfWorkers * maxMultiplier) expect(elapsedTime).toBeGreaterThanOrEqual(2000) - expect(elapsedTime).toBeLessThanOrEqual(tasksFinishedTimeout + 800) + // Worker kill message response timeout is 1000ms + expect(elapsedTime).toBeLessThanOrEqual( + tasksFinishedTimeout + 1000 * tasksFinished + 100 + ) }) it('Verify that destroy() waits until the tasks finished timeout is reached', async () => { -- 2.43.0