repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #880 from poolifier/dependabot/npm_and_yarn/examples/typescript...
[poolifier.git]
/
tests
/
pools
/
selection-strategies
/
selection-strategies.test.js
diff --git
a/tests/pools/selection-strategies/selection-strategies.test.js
b/tests/pools/selection-strategies/selection-strategies.test.js
index 8f09c5024b28e78342c4c6af029156ebff3b80e3..0e47e18efade43e35b2894ba6824d666ddb13daa 100644
(file)
--- a/
tests/pools/selection-strategies/selection-strategies.test.js
+++ b/
tests/pools/selection-strategies/selection-strategies.test.js
@@
-123,7
+123,7
@@
describe('Selection strategies test suite', () => {
{ workerChoiceStrategy }
)
expect(pool.workerChoiceStrategyContext.getStrategyPolicy()).toStrictEqual({
{ workerChoiceStrategy }
)
expect(pool.workerChoiceStrategyContext.getStrategyPolicy()).toStrictEqual({
- dynamicWorkerUsage:
tru
e,
+ dynamicWorkerUsage:
fals
e,
dynamicWorkerReady: true
})
await pool.destroy()
dynamicWorkerReady: true
})
await pool.destroy()
@@
-134,7
+134,7
@@
describe('Selection strategies test suite', () => {
{ workerChoiceStrategy }
)
expect(pool.workerChoiceStrategyContext.getStrategyPolicy()).toStrictEqual({
{ workerChoiceStrategy }
)
expect(pool.workerChoiceStrategyContext.getStrategyPolicy()).toStrictEqual({
- dynamicWorkerUsage:
tru
e,
+ dynamicWorkerUsage:
fals
e,
dynamicWorkerReady: true
})
// We need to clean up the resources after our test
dynamicWorkerReady: true
})
// We need to clean up the resources after our test
@@
-261,7
+261,7
@@
describe('Selection strategies test suite', () => {
for (const workerNode of pool.workerNodes) {
expect(workerNode.usage).toStrictEqual({
tasks: {
for (const workerNode of pool.workerNodes) {
expect(workerNode.usage).toStrictEqual({
tasks: {
- executed:
maxMultiplier
,
+ executed:
expect.any(Number)
,
executing: 0,
queued: 0,
maxQueued: 0,
executing: 0,
queued: 0,
maxQueued: 0,
@@
-282,6
+282,10
@@
describe('Selection strategies test suite', () => {
}
}
})
}
}
})
+ expect(workerNode.usage.tasks.executed).toBeGreaterThanOrEqual(0)
+ expect(workerNode.usage.tasks.executed).toBeLessThanOrEqual(
+ max * maxMultiplier
+ )
}
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(
}
expect(
pool.workerChoiceStrategyContext.workerChoiceStrategies.get(