- it('Simulate worker not found during increaseWorkerRunningTasks', async () => {
- const pool = new StubPoolWithWorkerTasksUsageMapClear(
- numberOfWorkers,
- './tests/worker-files/cluster/testWorker.js'
- )
- // Simulate worker not found.
- pool.removeAllWorker()
- expect(() => pool.increaseWorkerRunningTasks()).toThrowError(
- workerNotFoundInTasksUsageMapError
- )
- await pool.destroy()
- })
-
- it('Simulate worker not found during decreaseWorkerRunningTasks', async () => {
- const pool = new StubPoolWithWorkerTasksUsageMapClear(
- numberOfWorkers,
- './tests/worker-files/cluster/testWorker.js',
- {
- errorHandler: e => console.error(e)
- }
- )
- // Simulate worker not found.
- pool.removeAllWorker()
- expect(() => pool.decreaseWorkerRunningTasks()).toThrowError(
- workerNotFoundInTasksUsageMapError
- )
- await pool.destroy()
- })
-
- it('Simulate worker not found during stepWorkerRunTasks', async () => {
- const pool = new StubPoolWithWorkerTasksUsageMapClear(
+ it('Simulate worker not found during getWorkerTasksUsage', async () => {
+ const pool = new StubPoolWithRemoveAllWorker(