]> Piment Noir Git Repositories - poolifier.git/commitdiff
test: add sleep to avoid skipping
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 11 Jul 2025 15:11:29 +0000 (17:11 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 11 Jul 2025 15:11:29 +0000 (17:11 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
tests/pools/thread/fixed.test.mjs

index b1080d2a1388130e3caef4f05f4e274dae675ad7..703409855197327451fd8a02be1c41f4d2579e8b 100644 (file)
@@ -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')