Merge dependabot/npm_and_yarn/examples/typescript/http-server-pool/express-cluster...
[poolifier.git] / tests / pools / thread / fixed.test.mjs
index 3e10a92d0be8156f4dfd22289a0d3197a532fb1b..3da05735588953cf6c0882a30aa86a231dd8b841 100644 (file)
@@ -68,7 +68,7 @@ describe('Fixed thread pool test suite', () => {
     let result = await pool.execute({
       function: TaskFunctions.fibonacci
     })
-    expect(result).toBe(75025)
+    expect(result).toBe(354224848179262000000)
     result = await pool.execute({
       function: TaskFunctions.factorial
     })
@@ -348,7 +348,8 @@ describe('Fixed thread pool test suite', () => {
     })
     await expect(pool.destroyWorkerNode(workerNodeKey)).resolves.toBeUndefined()
     expect(exitEvent).toBe(1)
-    expect(pool.workerNodes.length).toBe(numberOfThreads - 1)
+    // Simulates an illegitimate worker node destroy and the minimum number of worker nodes is guaranteed
+    expect(pool.workerNodes.length).toBe(numberOfThreads)
     await pool.destroy()
   })