+ it('Verify LEAST_USED strategy default policy', async () => {
+ const workerChoiceStrategy = WorkerChoiceStrategies.LEAST_USED
+ let pool = new FixedThreadPool(
+ max,
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy }
+ )
+ expect(pool.workerChoiceStrategyContext.getStrategyPolicy()).toStrictEqual({
+ useDynamicWorker: false
+ })
+ await pool.destroy()
+ pool = new DynamicThreadPool(
+ min,
+ max,
+ './tests/worker-files/thread/testWorker.js',
+ { workerChoiceStrategy }
+ )
+ expect(pool.workerChoiceStrategyContext.getStrategyPolicy()).toStrictEqual({
+ useDynamicWorker: false
+ })
+ // We need to clean up the resources after our test
+ await pool.destroy()
+ })
+
+ it('Verify LEAST_USED strategy default tasks statistics requirements', async () => {