repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test: enchance worker node key choice tests
[poolifier.git]
/
tests
/
pools
/
abstract
/
abstract-pool.test.js
diff --git
a/tests/pools/abstract/abstract-pool.test.js
b/tests/pools/abstract/abstract-pool.test.js
index 81ae3649f1fd70f71e103a818ee51a172870bd7d..038868c2d1502ce721561b23c469bd845e69a8f1 100644
(file)
--- a/
tests/pools/abstract/abstract-pool.test.js
+++ b/
tests/pools/abstract/abstract-pool.test.js
@@
-12,9
+12,6
@@
const { Queue } = require('../../../lib/queue')
describe('Abstract pool test suite', () => {
const numberOfWorkers = 1
describe('Abstract pool test suite', () => {
const numberOfWorkers = 1
- const workerNotFoundInPoolError = new Error(
- 'Worker could not be found in the pool worker nodes'
- )
class StubPoolWithRemoveAllWorker extends FixedThreadPool {
removeAllWorker () {
this.workerNodes = []
class StubPoolWithRemoveAllWorker extends FixedThreadPool {
removeAllWorker () {
this.workerNodes = []
@@
-75,7
+72,7
@@
describe('Abstract pool test suite', () => {
new FixedThreadPool(0.25, './tests/worker-files/thread/testWorker.js')
).toThrowError(
new TypeError(
new FixedThreadPool(0.25, './tests/worker-files/thread/testWorker.js')
).toThrowError(
new TypeError(
- 'Cannot instantiate a pool with a non integer number of workers'
+ 'Cannot instantiate a pool with a non
safe
integer number of workers'
)
)
})
)
)
})
@@
-241,7
+238,7
@@
describe('Abstract pool test suite', () => {
await pool.destroy()
})
await pool.destroy()
})
- it('Simulate worker not found
at getWorkerTasksUsage()
', async () => {
+ it('Simulate worker not found', async () => {
const pool = new StubPoolWithRemoveAllWorker(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
const pool = new StubPoolWithRemoveAllWorker(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
@@
-253,9
+250,6
@@
describe('Abstract pool test suite', () => {
// Simulate worker not found.
pool.removeAllWorker()
expect(pool.workerNodes.length).toBe(0)
// Simulate worker not found.
pool.removeAllWorker()
expect(pool.workerNodes.length).toBe(0)
- expect(() => pool.getWorkerTasksUsage()).toThrowError(
- workerNotFoundInPoolError
- )
await pool.destroy()
})
await pool.destroy()
})