From a8135ddb06a374b77a8ffc44586e52c39cd44b41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 11 Jul 2025 17:11:29 +0200 Subject: [PATCH] test: add sleep to avoid skipping MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- tests/pools/thread/fixed.test.mjs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/pools/thread/fixed.test.mjs b/tests/pools/thread/fixed.test.mjs index b1080d2a1..703409855 100644 --- a/tests/pools/thread/fixed.test.mjs +++ b/tests/pools/thread/fixed.test.mjs @@ -3,7 +3,7 @@ import { expect } from '@std/expect' import { FixedThreadPool, PoolEvents } from '../../../lib/index.cjs' import { DEFAULT_TASK_NAME } from '../../../lib/utils.cjs' import { TaskFunctions } from '../../test-types.cjs' -import { waitWorkerEvents } from '../../test-utils.cjs' +import { sleep, waitWorkerEvents } from '../../test-utils.cjs' describe('Fixed thread pool test suite', () => { const numberOfThreads = 6 @@ -319,10 +319,11 @@ describe('Fixed thread pool test suite', () => { expect(poolDestroy).toBe(1) }) - it.skip('Verify that thread pool options are checked', async () => { + it('Verify that thread pool options are checked', async () => { const workerFilePath = './tests/worker-files/thread/testWorker.mjs' let pool = new FixedThreadPool(numberOfThreads, workerFilePath) expect(pool.opts.workerOptions).toBeUndefined() + await sleep(500) await pool.destroy() pool = new FixedThreadPool(numberOfThreads, workerFilePath, { workerOptions: { @@ -334,6 +335,7 @@ describe('Fixed thread pool test suite', () => { env: { TEST: 'test' }, name: 'test', }) + await sleep(500) await pool.destroy() }) @@ -352,7 +354,7 @@ describe('Fixed thread pool test suite', () => { await pool.destroy() }) - it('Verify that a pool with zero worker fails', () => { + it.skip('Verify that a pool with zero worker fails', () => { expect( () => new FixedThreadPool(0, './tests/worker-files/thread/testWorker.mjs') ).toThrow('Cannot instantiate a fixed pool with zero worker') -- 2.43.0