repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
docs: refine code comments
[poolifier.git]
/
tests
/
pools
/
selection-strategies
/
selection-strategies.test.mjs
diff --git
a/tests/pools/selection-strategies/selection-strategies.test.mjs
b/tests/pools/selection-strategies/selection-strategies.test.mjs
index 127377a26118c5d5be57cf98661eb9139fe5d81f..200e83c7c83af1eaca13ec86e62efee724402d3b 100644
(file)
--- a/
tests/pools/selection-strategies/selection-strategies.test.mjs
+++ b/
tests/pools/selection-strategies/selection-strategies.test.mjs
@@
-7,7
+7,6
@@
import {
WorkerChoiceStrategies
} from '../../../lib/index.js'
import { CircularArray } from '../../../lib/circular-array.js'
WorkerChoiceStrategies
} from '../../../lib/index.js'
import { CircularArray } from '../../../lib/circular-array.js'
-import { sleep } from '../../test-utils.js'
describe('Selection strategies test suite', () => {
const min = 0
describe('Selection strategies test suite', () => {
const min = 0
@@
-67,14
+66,9
@@
describe('Selection strategies test suite', () => {
expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
workerChoiceStrategy
)
expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
workerChoiceStrategy
)
- expect(pool.opts.workerChoiceStrategyOptions).toStrictEqual({
- retries: 6,
- runTime: { median: false },
- waitTime: { median: false },
- elu: { median: false }
- })
+ expect(pool.opts.workerChoiceStrategyOptions).toBeUndefined()
expect(pool.workerChoiceStrategyContext.opts).toStrictEqual({
expect(pool.workerChoiceStrategyContext.opts).toStrictEqual({
- retries:
6
,
+ retries:
pool.info.maxSize
,
runTime: { median: false },
waitTime: { median: false },
elu: { median: false }
runTime: { median: false },
waitTime: { median: false },
elu: { median: false }
@@
-87,19
+81,14
@@
describe('Selection strategies test suite', () => {
max,
'./tests/worker-files/cluster/testWorker.js'
)
max,
'./tests/worker-files/cluster/testWorker.js'
)
- pool.setWorkerChoiceStrategy(workerChoiceStrategy
, { retries: 3 }
)
+ pool.setWorkerChoiceStrategy(workerChoiceStrategy)
expect(pool.opts.workerChoiceStrategy).toBe(workerChoiceStrategy)
expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
workerChoiceStrategy
)
expect(pool.opts.workerChoiceStrategy).toBe(workerChoiceStrategy)
expect(pool.workerChoiceStrategyContext.workerChoiceStrategy).toBe(
workerChoiceStrategy
)
- expect(pool.opts.workerChoiceStrategyOptions).toStrictEqual({
- retries: 3,
- runTime: { median: false },
- waitTime: { median: false },
- elu: { median: false }
- })
+ expect(pool.opts.workerChoiceStrategyOptions).toBeUndefined()
expect(pool.workerChoiceStrategyContext.opts).toStrictEqual({
expect(pool.workerChoiceStrategyContext.opts).toStrictEqual({
- retries:
3
,
+ retries:
pool.info.maxSize
,
runTime: { median: false },
waitTime: { median: false },
elu: { median: false }
runTime: { median: false },
waitTime: { median: false },
elu: { median: false }
@@
-181,7
+170,6
@@
describe('Selection strategies test suite', () => {
max,
'./tests/worker-files/thread/testWorker.mjs'
)
max,
'./tests/worker-files/thread/testWorker.mjs'
)
- await sleep(600)
expect(pool.starting).toBe(false)
expect(pool.workerNodes.length).toBe(min)
const maxMultiplier = 10000
expect(pool.starting).toBe(false)
expect(pool.workerNodes.length).toBe(min)
const maxMultiplier = 10000