feat: add queued tasks end timeout support to worker node termination
[poolifier.git] / tests / pools / utils.test.mjs
index 5feb6596296914252a94231e5de19132968a832f..8c0a2b6ccf2f0502b915f985512a1624b1c730e0 100644 (file)
@@ -7,11 +7,23 @@ import {
 } from '../../lib/circular-array.js'
 import {
   createWorker,
+  getDefaultTasksQueueOptions,
   updateMeasurementStatistics
 } from '../../lib/pools/utils.js'
 import { WorkerTypes } from '../../lib/index.js'
 
 describe('Pool utils test suite', () => {
+  it('Verify getDefaultTasksQueueOptions() behavior', () => {
+    const poolMaxSize = 4
+    expect(getDefaultTasksQueueOptions(poolMaxSize)).toStrictEqual({
+      concurrency: 1,
+      size: Math.pow(poolMaxSize, 2),
+      taskStealing: true,
+      tasksStealingOnBackPressure: true,
+      tasksFinishedTimeout: 1000
+    })
+  })
+
   it('Verify updateMeasurementStatistics() behavior', () => {
     const measurementStatistics = {
       history: new CircularArray()