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
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: {
env: { TEST: 'test' },
name: 'test',
})
+ await sleep(500)
await pool.destroy()
})
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')