repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refine attributes scope in dynamic pool code
[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 bc7bdd1eb7932a90257bcb730f1e78f6dab4de43..273de9a038f0a02eb0e4d554bd717107e06394f3 100644
(file)
--- a/
tests/pools/abstract/abstract-pool.test.js
+++ b/
tests/pools/abstract/abstract-pool.test.js
@@
-11,12
+11,14
@@
describe('Abstract pool test suite', () => {
const workerNotFoundInTasksUsageMapError = new Error(
'Worker could not be found in workers tasks usage map'
)
const workerNotFoundInTasksUsageMapError = new Error(
'Worker could not be found in workers tasks usage map'
)
- class StubPoolWith
WorkerTasksUsageMapClea
r extends FixedThreadPool {
+ class StubPoolWith
RemoveAllWorke
r extends FixedThreadPool {
removeAllWorker () {
removeAllWorker () {
+ this.workers = []
this.workersTasksUsage.clear()
this.workersTasksUsage.clear()
+ this.promiseMap.clear()
}
}
}
}
- class StubPoolWithIsMain
Method
extends FixedThreadPool {
+ class StubPoolWithIsMain extends FixedThreadPool {
isMain () {
return false
}
isMain () {
return false
}
@@
-25,7
+27,7
@@
describe('Abstract pool test suite', () => {
it('Simulate pool creation from a non main thread/process', () => {
expect(
() =>
it('Simulate pool creation from a non main thread/process', () => {
expect(
() =>
- new StubPoolWithIsMain
Method
(
+ new StubPoolWithIsMain(
numberOfWorkers,
'./tests/worker-files/thread/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/thread/testWorker.js',
{
@@
-116,7
+118,7
@@
describe('Abstract pool test suite', () => {
})
it('Simulate worker not found during increaseWorkerRunningTasks', async () => {
})
it('Simulate worker not found during increaseWorkerRunningTasks', async () => {
- const pool = new StubPoolWith
WorkerTasksUsageMapClea
r(
+ const pool = new StubPoolWith
RemoveAllWorke
r(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js'
)
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js'
)
@@
-129,7
+131,7
@@
describe('Abstract pool test suite', () => {
})
it('Simulate worker not found during decreaseWorkerRunningTasks', async () => {
})
it('Simulate worker not found during decreaseWorkerRunningTasks', async () => {
- const pool = new StubPoolWith
WorkerTasksUsageMapClea
r(
+ const pool = new StubPoolWith
RemoveAllWorke
r(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
@@
-145,7
+147,7
@@
describe('Abstract pool test suite', () => {
})
it('Simulate worker not found during stepWorkerRunTasks', async () => {
})
it('Simulate worker not found during stepWorkerRunTasks', async () => {
- const pool = new StubPoolWith
WorkerTasksUsageMapClea
r(
+ const pool = new StubPoolWith
RemoveAllWorke
r(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
@@
-161,7
+163,7
@@
describe('Abstract pool test suite', () => {
})
it('Simulate worker not found during updateWorkerTasksRunTime with strategy not requiring it', async () => {
})
it('Simulate worker not found during updateWorkerTasksRunTime with strategy not requiring it', async () => {
- const pool = new StubPoolWith
WorkerTasksUsageMapClea
r(
+ const pool = new StubPoolWith
RemoveAllWorke
r(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
@@
-175,7
+177,7
@@
describe('Abstract pool test suite', () => {
})
it('Simulate worker not found during updateWorkerTasksRunTime with strategy requiring it', async () => {
})
it('Simulate worker not found during updateWorkerTasksRunTime with strategy requiring it', async () => {
- const pool = new StubPoolWith
WorkerTasksUsageMapClea
r(
+ const pool = new StubPoolWith
RemoveAllWorke
r(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{