refactor: rename worker choice strategies to sensible names
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 30 May 2023 08:40:59 +0000 (10:40 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 30 May 2023 08:40:59 +0000 (10:40 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
CHANGELOG.md
README.md
benchmarks/internal/bench.js
benchmarks/worker-selection/less.js
src/pools/selection-strategies/least-busy-worker-choice-strategy.ts [moved from src/pools/selection-strategies/less-busy-worker-choice-strategy.ts with 90% similarity]
src/pools/selection-strategies/least-used-worker-choice-strategy.ts [moved from src/pools/selection-strategies/less-used-worker-choice-strategy.ts with 90% similarity]
src/pools/selection-strategies/selection-strategies-types.ts
src/pools/selection-strategies/worker-choice-strategy-context.ts
tests/pools/abstract/abstract-pool.test.js
tests/pools/selection-strategies/selection-strategies.test.js
tests/pools/selection-strategies/worker-choice-strategy-context.test.js

index 200e61ddef934198b82a2d45515e9b86c7c5b7b0..920c0b4ba9bfdca7786564b33123d7de16efb098 100644 (file)
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 ## [Unreleased]
 
+### Added
+
+- Switch pool event emitter to `EventEmitterAsyncResource`.
+
+### Changed
+
+- Renamed worker choice strategy `LESS_BUSY` to `LEAST_BUSY` and `LESS_USED` to `LEAST_USED`.
+
 ## [2.4.14] - 2023-05-09
 
 ### Fixed
index 3eeebed184aa73b2417537a8b3e3e48d5af10f8a..52650f3e72b10aa40fc4bd427206e634ca836ad1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -162,8 +162,8 @@ Node versions >= 16.14.x are supported.
 - `workerChoiceStrategy` (optional) - The worker choice strategy to use in this pool:
 
   - `WorkerChoiceStrategies.ROUND_ROBIN`: Submit tasks to worker in a round robbin fashion
-  - `WorkerChoiceStrategies.LESS_USED`: Submit tasks to the less used worker
-  - `WorkerChoiceStrategies.LESS_BUSY`: Submit tasks to the less busy worker
+  - `WorkerChoiceStrategies.LEAST_USED`: Submit tasks to the least used worker
+  - `WorkerChoiceStrategies.LEAST_BUSY`: Submit tasks to the least busy worker
   - `WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN`: Submit tasks to worker using a weighted round robin scheduling algorithm based on tasks execution time
   - `WorkerChoiceStrategies.FAIR_SHARE`: Submit tasks to worker using a fair share tasks scheduling algorithm based on tasks execution time
 
index 4663d9c42bf2f27f38b78cb417acbe96bf6f2e86..94b49f13bd94233cb32f7330b73a444841c015e5 100644 (file)
@@ -17,11 +17,11 @@ const tasksQueuePoolOption = { enableTasksQueue: true }
 const workerChoiceStrategyRoundRobinPoolOption = {
   workerChoiceStrategy: WorkerChoiceStrategies.ROUND_ROBIN
 }
-const workerChoiceStrategyLessUsedPoolOption = {
-  workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED
+const workerChoiceStrategyLeastUsedPoolOption = {
+  workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED
 }
-const workerChoiceStrategyLessBusyPoolOption = {
-  workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY
+const workerChoiceStrategyLeastBusyPoolOption = {
+  workerChoiceStrategy: WorkerChoiceStrategies.LEAST_BUSY
 }
 const workerChoiceStrategyWeightedRoundRobinPoolOption = {
   workerChoiceStrategy: WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
@@ -44,18 +44,18 @@ const fixedThreadPoolRoundRobinTasksQueue = buildPool(
   { ...workerChoiceStrategyRoundRobinPoolOption, ...tasksQueuePoolOption }
 )
 
-const fixedThreadPoolLessUsed = buildPool(
+const fixedThreadPoolLeastUsed = buildPool(
   WorkerTypes.THREAD,
   PoolTypes.FIXED,
   poolSize,
-  workerChoiceStrategyLessUsedPoolOption
+  workerChoiceStrategyLeastUsedPoolOption
 )
 
-const fixedThreadPoolLessBusy = buildPool(
+const fixedThreadPoolLeastBusy = buildPool(
   WorkerTypes.THREAD,
   PoolTypes.FIXED,
   poolSize,
-  workerChoiceStrategyLessBusyPoolOption
+  workerChoiceStrategyLeastBusyPoolOption
 )
 
 const fixedThreadPoolWeightedRoundRobin = buildPool(
@@ -86,18 +86,18 @@ const dynamicThreadPoolRoundRobin = buildPool(
   workerChoiceStrategyRoundRobinPoolOption
 )
 
-const dynamicThreadPoolLessUsed = buildPool(
+const dynamicThreadPoolLeastUsed = buildPool(
   WorkerTypes.THREAD,
   PoolTypes.DYNAMIC,
   poolSize,
-  workerChoiceStrategyLessUsedPoolOption
+  workerChoiceStrategyLeastUsedPoolOption
 )
 
-const dynamicThreadPoolLessBusy = buildPool(
+const dynamicThreadPoolLeastBusy = buildPool(
   WorkerTypes.THREAD,
   PoolTypes.DYNAMIC,
   poolSize,
-  workerChoiceStrategyLessBusyPoolOption
+  workerChoiceStrategyLeastBusyPoolOption
 )
 
 const dynamicThreadPoolWeightedRoundRobin = buildPool(
@@ -128,18 +128,18 @@ const fixedClusterPoolRoundRobinTasksQueue = buildPool(
   { ...workerChoiceStrategyRoundRobinPoolOption, ...tasksQueuePoolOption }
 )
 
-const fixedClusterPoolLessUsed = buildPool(
+const fixedClusterPoolLeastUsed = buildPool(
   WorkerTypes.CLUSTER,
   PoolTypes.FIXED,
   poolSize,
-  workerChoiceStrategyLessUsedPoolOption
+  workerChoiceStrategyLeastUsedPoolOption
 )
 
-const fixedClusterPoolLessBusy = buildPool(
+const fixedClusterPoolLeastBusy = buildPool(
   WorkerTypes.CLUSTER,
   PoolTypes.FIXED,
   poolSize,
-  workerChoiceStrategyLessBusyPoolOption
+  workerChoiceStrategyLeastBusyPoolOption
 )
 
 const fixedClusterPoolWeightedRoundRobin = buildPool(
@@ -170,18 +170,18 @@ const dynamicClusterPoolRoundRobin = buildPool(
   workerChoiceStrategyRoundRobinPoolOption
 )
 
-const dynamicClusterPoolLessUsed = buildPool(
+const dynamicClusterPoolLeastUsed = buildPool(
   WorkerTypes.CLUSTER,
   PoolTypes.DYNAMIC,
   poolSize,
-  workerChoiceStrategyLessUsedPoolOption
+  workerChoiceStrategyLeastUsedPoolOption
 )
 
-const dynamicClusterPoolLessBusy = buildPool(
+const dynamicClusterPoolLeastBusy = buildPool(
   WorkerTypes.CLUSTER,
   PoolTypes.DYNAMIC,
   poolSize,
-  workerChoiceStrategyLessBusyPoolOption
+  workerChoiceStrategyLeastBusyPoolOption
 )
 
 const dynamicClusterPoolWeightedRoundRobin = buildPool(
@@ -218,14 +218,14 @@ Benchmark.suite(
       })
     }
   ),
-  Benchmark.add('Fixed:ThreadPool:LessUsed', async () => {
-    await runTest(fixedThreadPoolLessUsed, {
+  Benchmark.add('Fixed:ThreadPool:LeastUsed', async () => {
+    await runTest(fixedThreadPoolLeastUsed, {
       taskExecutions,
       workerData
     })
   }),
-  Benchmark.add('Fixed:ThreadPool:LessBusy', async () => {
-    await runTest(fixedThreadPoolLessBusy, {
+  Benchmark.add('Fixed:ThreadPool:LeastBusy', async () => {
+    await runTest(fixedThreadPoolLeastBusy, {
       taskExecutions,
       workerData
     })
@@ -257,14 +257,14 @@ Benchmark.suite(
       workerData
     })
   }),
-  Benchmark.add('Dynamic:ThreadPool:LessUsed', async () => {
-    await runTest(dynamicThreadPoolLessUsed, {
+  Benchmark.add('Dynamic:ThreadPool:LeastUsed', async () => {
+    await runTest(dynamicThreadPoolLeastUsed, {
       taskExecutions,
       workerData
     })
   }),
-  Benchmark.add('Dynamic:ThreadPool:LessBusy', async () => {
-    await runTest(dynamicThreadPoolLessBusy, {
+  Benchmark.add('Dynamic:ThreadPool:LeastBusy', async () => {
+    await runTest(dynamicThreadPoolLeastBusy, {
       taskExecutions,
       workerData
     })
@@ -296,14 +296,14 @@ Benchmark.suite(
       })
     }
   ),
-  Benchmark.add('Fixed:ClusterPool:LessUsed', async () => {
-    await runTest(fixedClusterPoolLessUsed, {
+  Benchmark.add('Fixed:ClusterPool:LeastUsed', async () => {
+    await runTest(fixedClusterPoolLeastUsed, {
       taskExecutions,
       workerData
     })
   }),
-  Benchmark.add('Fixed:ClusterPool:LessBusy', async () => {
-    await runTest(fixedClusterPoolLessBusy, {
+  Benchmark.add('Fixed:ClusterPool:LeastBusy', async () => {
+    await runTest(fixedClusterPoolLeastBusy, {
       taskExecutions,
       workerData
     })
@@ -335,14 +335,14 @@ Benchmark.suite(
       workerData
     })
   }),
-  Benchmark.add('Dynamic:ClusterPool:LessUsed', async () => {
-    await runTest(dynamicClusterPoolLessUsed, {
+  Benchmark.add('Dynamic:ClusterPool:LeastUsed', async () => {
+    await runTest(dynamicClusterPoolLeastUsed, {
       taskExecutions,
       workerData
     })
   }),
-  Benchmark.add('Dynamic:ClusterPool:LessBusy', async () => {
-    await runTest(dynamicClusterPoolLessBusy, {
+  Benchmark.add('Dynamic:ClusterPool:LeastBusy', async () => {
+    await runTest(dynamicClusterPoolLeastBusy, {
       taskExecutions,
       workerData
     })
index 80d78893061e5d943eb467736759cc4adbc76ce5..3733cf6d336b5835979db48093823b126daf2559 100644 (file)
@@ -168,7 +168,7 @@ function quickSelectRecursionRandomPivot (tasksMap) {
 }
 
 Benchmark.suite(
-  'Less used worker tasks distribution',
+  'Least used worker tasks distribution',
   Benchmark.add('Loop select', () => {
     loopSelect(tasksMap)
   }),
similarity index 90%
rename from src/pools/selection-strategies/less-busy-worker-choice-strategy.ts
rename to src/pools/selection-strategies/least-busy-worker-choice-strategy.ts
index f518f9b17f311ad3a8ad262e3b7e5f0be15cc61b..05caa42a0149ebc7dc29ef76edc3a025e8b24c2c 100644 (file)
@@ -9,13 +9,13 @@ import type {
 } from './selection-strategies-types'
 
 /**
- * Selects the less busy worker.
+ * Selects the least busy worker.
  *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be serializable data.
  * @typeParam Response - Type of execution response. This can only be serializable data.
  */
-export class LessBusyWorkerChoiceStrategy<
+export class LeastBusyWorkerChoiceStrategy<
     Worker extends IWorker,
     Data = unknown,
     Response = unknown
@@ -55,17 +55,17 @@ export class LessBusyWorkerChoiceStrategy<
       return freeWorkerNodeKey
     }
     let minRunTime = Infinity
-    let lessBusyWorkerNodeKey!: number
+    let leastBusyWorkerNodeKey!: number
     for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
       const workerRunTime = workerNode.tasksUsage.runTime
       if (workerRunTime === 0) {
         return workerNodeKey
       } else if (workerRunTime < minRunTime) {
         minRunTime = workerRunTime
-        lessBusyWorkerNodeKey = workerNodeKey
+        leastBusyWorkerNodeKey = workerNodeKey
       }
     }
-    return lessBusyWorkerNodeKey
+    return leastBusyWorkerNodeKey
   }
 
   /** @inheritDoc */
similarity index 90%
rename from src/pools/selection-strategies/less-used-worker-choice-strategy.ts
rename to src/pools/selection-strategies/least-used-worker-choice-strategy.ts
index a8daa7b9f43d05e871cf38e0822cb986ba671239..85e145a041b7868bc96565091a0beec16b7b6d89 100644 (file)
@@ -8,13 +8,13 @@ import type {
 } from './selection-strategies-types'
 
 /**
- * Selects the less used worker.
+ * Selects the least used worker.
  *
  * @typeParam Worker - Type of worker which manages the strategy.
  * @typeParam Data - Type of data sent to the worker. This can only be serializable data.
  * @typeParam Response - Type of execution response. This can only be serializable data.
  */
-export class LessUsedWorkerChoiceStrategy<
+export class LeastUsedWorkerChoiceStrategy<
     Worker extends IWorker,
     Data = unknown,
     Response = unknown
@@ -47,7 +47,7 @@ export class LessUsedWorkerChoiceStrategy<
       return freeWorkerNodeKey
     }
     let minNumberOfTasks = Infinity
-    let lessUsedWorkerNodeKey!: number
+    let leastUsedWorkerNodeKey!: number
     for (const [workerNodeKey, workerNode] of this.pool.workerNodes.entries()) {
       const tasksUsage = workerNode.tasksUsage
       const workerTasks = tasksUsage.run + tasksUsage.running
@@ -55,10 +55,10 @@ export class LessUsedWorkerChoiceStrategy<
         return workerNodeKey
       } else if (workerTasks < minNumberOfTasks) {
         minNumberOfTasks = workerTasks
-        lessUsedWorkerNodeKey = workerNodeKey
+        leastUsedWorkerNodeKey = workerNodeKey
       }
     }
-    return lessUsedWorkerNodeKey
+    return leastUsedWorkerNodeKey
   }
 
   /** @inheritDoc */
index ddfe915d2e3c215f9365693c81754155c2c10bc5..282e306db18a4c55bb1016e078ce8456ff64d843 100644 (file)
@@ -7,13 +7,13 @@ export const WorkerChoiceStrategies = Object.freeze({
    */
   ROUND_ROBIN: 'ROUND_ROBIN',
   /**
-   * Less used worker selection strategy.
+   * Least used worker selection strategy.
    */
-  LESS_USED: 'LESS_USED',
+  LEAST_USED: 'LEAST_USED',
   /**
-   * Less busy worker selection strategy.
+   * Least busy worker selection strategy.
    */
-  LESS_BUSY: 'LESS_BUSY',
+  LEAST_BUSY: 'LEAST_BUSY',
   /**
    * Fair share worker selection strategy.
    */
index e07808bcefe837ef5289be98db46ac3664607219..21c24f7c63799561f1b32e17ebda121b5a2464d3 100644 (file)
@@ -2,8 +2,8 @@ import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
 import type { IPool } from '../pool'
 import type { IWorker } from '../worker'
 import { FairShareWorkerChoiceStrategy } from './fair-share-worker-choice-strategy'
-import { LessBusyWorkerChoiceStrategy } from './less-busy-worker-choice-strategy'
-import { LessUsedWorkerChoiceStrategy } from './less-used-worker-choice-strategy'
+import { LeastBusyWorkerChoiceStrategy } from './least-busy-worker-choice-strategy'
+import { LeastUsedWorkerChoiceStrategy } from './least-used-worker-choice-strategy'
 import { RoundRobinWorkerChoiceStrategy } from './round-robin-worker-choice-strategy'
 import type {
   IWorkerChoiceStrategy,
@@ -56,15 +56,15 @@ export class WorkerChoiceStrategyContext<
         )
       ],
       [
-        WorkerChoiceStrategies.LESS_USED,
-        new (LessUsedWorkerChoiceStrategy.bind(this))<Worker, Data, Response>(
+        WorkerChoiceStrategies.LEAST_USED,
+        new (LeastUsedWorkerChoiceStrategy.bind(this))<Worker, Data, Response>(
           pool,
           opts
         )
       ],
       [
-        WorkerChoiceStrategies.LESS_BUSY,
-        new (LessBusyWorkerChoiceStrategy.bind(this))<Worker, Data, Response>(
+        WorkerChoiceStrategies.LEAST_BUSY,
+        new (LeastBusyWorkerChoiceStrategy.bind(this))<Worker, Data, Response>(
           pool,
           opts
         )
index bf01176de969fe3668ce8ded789673837c4b3fd6..02baefaf93b5639867d8bb6e852dce39c25dfa57 100644 (file)
@@ -102,7 +102,7 @@ describe('Abstract pool test suite', () => {
       numberOfWorkers,
       './tests/worker-files/thread/testWorker.js',
       {
-        workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED,
+        workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED,
         workerChoiceStrategyOptions: {
           medRunTime: true,
           weights: { 0: 300 }
@@ -121,7 +121,7 @@ describe('Abstract pool test suite', () => {
     expect(pool.opts.enableTasksQueue).toBe(true)
     expect(pool.opts.tasksQueueOptions).toStrictEqual({ concurrency: 2 })
     expect(pool.opts.workerChoiceStrategy).toBe(
-      WorkerChoiceStrategies.LESS_USED
+      WorkerChoiceStrategies.LEAST_USED
     )
     expect(pool.opts.workerChoiceStrategyOptions).toStrictEqual({
       medRunTime: true,
index 33d2114c09bc4e02eb45f2f46a7b5d13537e9911..9e3e99e3ba3f1291ea4ebe1893588c084ed064f7 100644 (file)
@@ -12,8 +12,8 @@ describe('Selection strategies test suite', () => {
 
   it('Verify that WorkerChoiceStrategies enumeration provides string values', () => {
     expect(WorkerChoiceStrategies.ROUND_ROBIN).toBe('ROUND_ROBIN')
-    expect(WorkerChoiceStrategies.LESS_USED).toBe('LESS_USED')
-    expect(WorkerChoiceStrategies.LESS_BUSY).toBe('LESS_BUSY')
+    expect(WorkerChoiceStrategies.LEAST_USED).toBe('LEAST_USED')
+    expect(WorkerChoiceStrategies.LEAST_BUSY).toBe('LEAST_BUSY')
     expect(WorkerChoiceStrategies.FAIR_SHARE).toBe('FAIR_SHARE')
     expect(WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN).toBe(
       'WEIGHTED_ROUND_ROBIN'
@@ -243,8 +243,8 @@ describe('Selection strategies test suite', () => {
     await pool.destroy()
   })
 
-  it('Verify LESS_USED strategy default tasks usage statistics requirements', async () => {
-    const workerChoiceStrategy = WorkerChoiceStrategies.LESS_USED
+  it('Verify LEAST_USED strategy default tasks usage statistics requirements', async () => {
+    const workerChoiceStrategy = WorkerChoiceStrategies.LEAST_USED
     let pool = new FixedThreadPool(
       max,
       './tests/worker-files/thread/testWorker.js',
@@ -279,13 +279,13 @@ describe('Selection strategies test suite', () => {
     await pool.destroy()
   })
 
-  it('Verify LESS_USED strategy can be run in a fixed pool', async () => {
+  it('Verify LEAST_USED strategy can be run in a fixed pool', async () => {
     const pool = new FixedThreadPool(
       max,
       './tests/worker-files/thread/testWorker.js',
-      { workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
+      { workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED }
     )
-    // TODO: Create a better test to cover `LessUsedWorkerChoiceStrategy#choose`
+    // TODO: Create a better test to cover `LeastUsedWorkerChoiceStrategy#choose`
     const maxMultiplier = 2
     for (let i = 0; i < max * maxMultiplier; i++) {
       await pool.execute()
@@ -294,14 +294,14 @@ describe('Selection strategies test suite', () => {
     await pool.destroy()
   })
 
-  it('Verify LESS_USED strategy can be run in a dynamic pool', async () => {
+  it('Verify LEAST_USED strategy can be run in a dynamic pool', async () => {
     const pool = new DynamicThreadPool(
       min,
       max,
       './tests/worker-files/thread/testWorker.js',
-      { workerChoiceStrategy: WorkerChoiceStrategies.LESS_USED }
+      { workerChoiceStrategy: WorkerChoiceStrategies.LEAST_USED }
     )
-    // TODO: Create a better test to cover `LessUsedWorkerChoiceStrategy#choose`
+    // TODO: Create a better test to cover `LeastUsedWorkerChoiceStrategy#choose`
     const maxMultiplier = 2
     for (let i = 0; i < max * maxMultiplier; i++) {
       await pool.execute()
@@ -310,8 +310,8 @@ describe('Selection strategies test suite', () => {
     await pool.destroy()
   })
 
-  it('Verify LESS_BUSY strategy default tasks usage statistics requirements', async () => {
-    const workerChoiceStrategy = WorkerChoiceStrategies.LESS_BUSY
+  it('Verify LEAST_BUSY strategy default tasks usage statistics requirements', async () => {
+    const workerChoiceStrategy = WorkerChoiceStrategies.LEAST_BUSY
     let pool = new FixedThreadPool(
       max,
       './tests/worker-files/thread/testWorker.js',
@@ -346,13 +346,13 @@ describe('Selection strategies test suite', () => {
     await pool.destroy()
   })
 
-  it('Verify LESS_BUSY strategy can be run in a fixed pool', async () => {
+  it('Verify LEAST_BUSY strategy can be run in a fixed pool', async () => {
     const pool = new FixedThreadPool(
       max,
       './tests/worker-files/thread/testWorker.js',
-      { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
+      { workerChoiceStrategy: WorkerChoiceStrategies.LEAST_BUSY }
     )
-    // TODO: Create a better test to cover `LessBusyWorkerChoiceStrategy#choose`
+    // TODO: Create a better test to cover `LeastBusyWorkerChoiceStrategy#choose`
     const maxMultiplier = 2
     for (let i = 0; i < max * maxMultiplier; i++) {
       await pool.execute()
@@ -361,14 +361,14 @@ describe('Selection strategies test suite', () => {
     await pool.destroy()
   })
 
-  it('Verify LESS_BUSY strategy can be run in a dynamic pool', async () => {
+  it('Verify LEAST_BUSY strategy can be run in a dynamic pool', async () => {
     const pool = new DynamicThreadPool(
       min,
       max,
       './tests/worker-files/thread/testWorker.js',
-      { workerChoiceStrategy: WorkerChoiceStrategies.LESS_BUSY }
+      { workerChoiceStrategy: WorkerChoiceStrategies.LEAST_BUSY }
     )
-    // TODO: Create a better test to cover `LessBusyWorkerChoiceStrategy#choose`
+    // TODO: Create a better test to cover `LeastBusyWorkerChoiceStrategy#choose`
     const maxMultiplier = 2
     for (let i = 0; i < max * maxMultiplier; i++) {
       await pool.execute()
index fa380a5ae4320f0f4056bd48462e940992c60288..b36ec277d03f1c6728949f16981dd1252029a77b 100644 (file)
@@ -12,11 +12,11 @@ const {
   RoundRobinWorkerChoiceStrategy
 } = require('../../../lib/pools/selection-strategies/round-robin-worker-choice-strategy')
 const {
-  LessUsedWorkerChoiceStrategy
-} = require('../../../lib/pools/selection-strategies/less-used-worker-choice-strategy')
+  LeastUsedWorkerChoiceStrategy
+} = require('../../../lib/pools/selection-strategies/least-used-worker-choice-strategy')
 const {
-  LessBusyWorkerChoiceStrategy
-} = require('../../../lib/pools/selection-strategies/less-busy-worker-choice-strategy')
+  LeastBusyWorkerChoiceStrategy
+} = require('../../../lib/pools/selection-strategies/least-busy-worker-choice-strategy')
 const {
   FairShareWorkerChoiceStrategy
 } = require('../../../lib/pools/selection-strategies/fair-share-worker-choice-strategy')
@@ -194,8 +194,8 @@ describe('Worker choice strategy context test suite', () => {
     )
   })
 
-  it('Verify that setWorkerChoiceStrategy() works with LESS_USED and fixed pool', () => {
-    const workerChoiceStrategy = WorkerChoiceStrategies.LESS_USED
+  it('Verify that setWorkerChoiceStrategy() works with LEAST_USED and fixed pool', () => {
+    const workerChoiceStrategy = WorkerChoiceStrategies.LEAST_USED
     const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
       fixedPool
     )
@@ -204,14 +204,14 @@ describe('Worker choice strategy context test suite', () => {
       workerChoiceStrategyContext.workerChoiceStrategies.get(
         workerChoiceStrategy
       )
-    ).toBeInstanceOf(LessUsedWorkerChoiceStrategy)
+    ).toBeInstanceOf(LeastUsedWorkerChoiceStrategy)
     expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
       workerChoiceStrategy
     )
   })
 
-  it('Verify that setWorkerChoiceStrategy() works with LESS_USED and dynamic pool', () => {
-    const workerChoiceStrategy = WorkerChoiceStrategies.LESS_USED
+  it('Verify that setWorkerChoiceStrategy() works with LEAST_USED and dynamic pool', () => {
+    const workerChoiceStrategy = WorkerChoiceStrategies.LEAST_USED
     const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
       dynamicPool
     )
@@ -220,14 +220,14 @@ describe('Worker choice strategy context test suite', () => {
       workerChoiceStrategyContext.workerChoiceStrategies.get(
         workerChoiceStrategy
       )
-    ).toBeInstanceOf(LessUsedWorkerChoiceStrategy)
+    ).toBeInstanceOf(LeastUsedWorkerChoiceStrategy)
     expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
       workerChoiceStrategy
     )
   })
 
-  it('Verify that setWorkerChoiceStrategy() works with LESS_BUSY and fixed pool', () => {
-    const workerChoiceStrategy = WorkerChoiceStrategies.LESS_BUSY
+  it('Verify that setWorkerChoiceStrategy() works with LEAST_BUSY and fixed pool', () => {
+    const workerChoiceStrategy = WorkerChoiceStrategies.LEAST_BUSY
     const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
       fixedPool
     )
@@ -236,14 +236,14 @@ describe('Worker choice strategy context test suite', () => {
       workerChoiceStrategyContext.workerChoiceStrategies.get(
         workerChoiceStrategy
       )
-    ).toBeInstanceOf(LessBusyWorkerChoiceStrategy)
+    ).toBeInstanceOf(LeastBusyWorkerChoiceStrategy)
     expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
       workerChoiceStrategy
     )
   })
 
-  it('Verify that setWorkerChoiceStrategy() works with LESS_BUSY and dynamic pool', () => {
-    const workerChoiceStrategy = WorkerChoiceStrategies.LESS_BUSY
+  it('Verify that setWorkerChoiceStrategy() works with LEAST_BUSY and dynamic pool', () => {
+    const workerChoiceStrategy = WorkerChoiceStrategies.LEAST_BUSY
     const workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
       dynamicPool
     )
@@ -252,7 +252,7 @@ describe('Worker choice strategy context test suite', () => {
       workerChoiceStrategyContext.workerChoiceStrategies.get(
         workerChoiceStrategy
       )
-    ).toBeInstanceOf(LessBusyWorkerChoiceStrategy)
+    ).toBeInstanceOf(LeastBusyWorkerChoiceStrategy)
     expect(workerChoiceStrategyContext.workerChoiceStrategy).toBe(
       workerChoiceStrategy
     )