repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: use SMA and SMM for worker tasks usage
[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 236d34efc8ca7fea74462c80892561f5dcb5cfe2..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(
@@
-1838,6
+1842,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(