- it('Verify LESS_USED strategy is taken at pool creation', async () => {
- const pool = new FixedThreadPool(
- max,
- './tests/worker-files/thread/testWorker.js',
- { workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
- )
- expect(pool.opts.workerChoiceStrategy).toBe(
- WorkerChoiceStrategies.LESS_USED
- )
- // We need to clean up the resources after our test
- await pool.destroy()
- })
-
- it('Verify LESS_USED strategy can be set after pool creation', async () => {
- const pool = new FixedThreadPool(
- max,
- './tests/worker-files/thread/testWorker.js'
- )
- pool.setWorkerChoiceStrategy(WorkerChoiceStrategies.LESS_USED)
- expect(pool.opts.workerChoiceStrategy).toBe(
- WorkerChoiceStrategies.LESS_USED
- )
- // We need to clean up the resources after our test
- await pool.destroy()
- })
-
- it('Verify LESS_USED strategy default tasks usage statistics requirements', async () => {
+ it('Verify LEAST_USED strategy default tasks usage statistics requirements', async () => {
+ const workerChoiceStrategy = WorkerChoiceStrategies.LEAST_USED