repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/fastify-worker_thr...
[poolifier.git]
/
tests
/
pools
/
thread
/
dynamic.test.mjs
diff --git
a/tests/pools/thread/dynamic.test.mjs
b/tests/pools/thread/dynamic.test.mjs
index 2b5dd6112fac7c9664ec6a0ad7a0ce027aa4f371..77c5aaeb5afd3893c8c7eb265a7d65ed4d3cdda6 100644
(file)
--- a/
tests/pools/thread/dynamic.test.mjs
+++ b/
tests/pools/thread/dynamic.test.mjs
@@
-158,14
+158,16
@@
describe('Dynamic thread pool test suite', () => {
})
it('Verify that a pool with zero worker works', async () => {
})
it('Verify that a pool with zero worker works', async () => {
- const pool = new DynamicThreadPool(
- 0,
- max,
- './tests/worker-files/thread/testWorker.mjs'
- )
- expect(pool.starting).toBe(false)
for (const workerChoiceStrategy of Object.values(WorkerChoiceStrategies)) {
for (const workerChoiceStrategy of Object.values(WorkerChoiceStrategies)) {
- pool.setWorkerChoiceStrategy(workerChoiceStrategy)
+ const pool = new DynamicThreadPool(
+ 0,
+ max,
+ './tests/worker-files/thread/testWorker.mjs',
+ {
+ workerChoiceStrategy
+ }
+ )
+ expect(pool.starting).toBe(false)
expect(pool.readyEventEmitted).toBe(false)
for (let run = 0; run < 2; run++) {
run % 2 !== 0 && pool.enableTasksQueue(true)
expect(pool.readyEventEmitted).toBe(false)
for (let run = 0; run < 2; run++) {
run % 2 !== 0 && pool.enableTasksQueue(true)
@@
-183,8
+185,8
@@
describe('Dynamic thread pool test suite', () => {
expect(pool.readyEventEmitted).toBe(false)
expect(pool.workerNodes.length).toBe(pool.info.minSize)
}
expect(pool.readyEventEmitted).toBe(false)
expect(pool.workerNodes.length).toBe(pool.info.minSize)
}
+ // We need to clean up the resources after our test
+ await pool.destroy()
}
}
- // We need to clean up the resources after our test
- await pool.destroy()
})
})
})
})