summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
09c9445)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
*/
public constructor (
min: number,
*/
public constructor (
min: number,
- public readonly max: number,
+ protected readonly max: number,
filePath: string,
opts: ClusterPoolOptions = {}
) {
filePath: string,
opts: ClusterPoolOptions = {}
) {
*/
public constructor (
min: number,
*/
public constructor (
min: number,
- public readonly max: number,
+ protected readonly max: number,
filePath: string,
opts: PoolOptions<ThreadWorkerWithMessageChannel> = {}
) {
filePath: string,
opts: PoolOptions<ThreadWorkerWithMessageChannel> = {}
) {
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 StubPoolWithWorkerTasksUsageMapClear extends FixedThreadPool {
+ class StubPoolWithRemoveAllWorker extends FixedThreadPool {
this.workersTasksUsage.clear()
this.workersTasksUsage.clear()
+ this.promiseMap.clear()
- class StubPoolWithIsMainMethod extends FixedThreadPool {
+ class StubPoolWithIsMain extends FixedThreadPool {
isMain () {
return false
}
isMain () {
return false
}
it('Simulate pool creation from a non main thread/process', () => {
expect(
() =>
it('Simulate pool creation from a non main thread/process', () => {
expect(
() =>
- new StubPoolWithIsMainMethod(
+ new StubPoolWithIsMain(
numberOfWorkers,
'./tests/worker-files/thread/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/thread/testWorker.js',
{
})
it('Simulate worker not found during increaseWorkerRunningTasks', async () => {
})
it('Simulate worker not found during increaseWorkerRunningTasks', async () => {
- const pool = new StubPoolWithWorkerTasksUsageMapClear(
+ const pool = new StubPoolWithRemoveAllWorker(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js'
)
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js'
)
})
it('Simulate worker not found during decreaseWorkerRunningTasks', async () => {
})
it('Simulate worker not found during decreaseWorkerRunningTasks', async () => {
- const pool = new StubPoolWithWorkerTasksUsageMapClear(
+ const pool = new StubPoolWithRemoveAllWorker(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
})
it('Simulate worker not found during stepWorkerRunTasks', async () => {
})
it('Simulate worker not found during stepWorkerRunTasks', async () => {
- const pool = new StubPoolWithWorkerTasksUsageMapClear(
+ const pool = new StubPoolWithRemoveAllWorker(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
})
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 StubPoolWithWorkerTasksUsageMapClear(
+ const pool = new StubPoolWithRemoveAllWorker(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
})
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 StubPoolWithWorkerTasksUsageMapClear(
+ const pool = new StubPoolWithRemoveAllWorker(
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{
numberOfWorkers,
'./tests/worker-files/cluster/testWorker.js',
{