- it('Simulate worker not found during stepWorkerRunTasks', async () => {
- const pool = new StubPoolWithRemoveAllWorker(
- numberOfWorkers,
- './tests/worker-files/cluster/testWorker.js',
- {
- errorHandler: e => console.error(e)
- }
- )
- // Simulate worker not found.
- pool.removeAllWorker()
- expect(() => pool.stepWorkerRunTasks()).toThrowError(
- workerNotFoundInTasksUsageMapError
- )
- await pool.destroy()
- })
-
- it('Simulate worker not found during updateWorkerTasksRunTime with strategy not requiring it', async () => {
- const pool = new StubPoolWithRemoveAllWorker(
- numberOfWorkers,
- './tests/worker-files/cluster/testWorker.js',
- {
- errorHandler: e => console.error(e)
- }
- )
- // Simulate worker not found.
- pool.removeAllWorker()
- expect(() => pool.updateWorkerTasksRunTime()).not.toThrowError()
- await pool.destroy()
- })
-
- it('Simulate worker not found during updateWorkerTasksRunTime with strategy requiring it', async () => {
- const pool = new StubPoolWithRemoveAllWorker(
+ it('Verify that worker pool tasks usage are initialized', async () => {
+ const pool = new FixedClusterPool(