]> Piment Noir Git Repositories - poolifier.git/commitdiff
test: refine pool destroy time expectation
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 10 Jul 2025 14:36:54 +0000 (16:36 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 10 Jul 2025 14:36:54 +0000 (16:36 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/queues/abstract-fixed-queue.ts
src/queues/fixed-priority-queue.ts
tests/pools/abstract-pool.test.mjs

index 54dee480ebd3e23adf56a7331a58e2d4749d498e..36f178f5528219bb1903be27075f972a0edd1de0 100644 (file)
@@ -55,7 +55,7 @@ export abstract class AbstractFixedQueue<T> implements IFixedQueue<T> {
         logicalIndex = i
         break
       }
-      currentPhysicalIndex++
+      ++currentPhysicalIndex
       if (currentPhysicalIndex === this.capacity) {
         currentPhysicalIndex = 0
       }
index d7f65b5ad370f8dfaedd811bdd24b98cfcea782c..35b262d6e74d887d196eb3d2961a9f1dc64f57ed 100644 (file)
@@ -24,7 +24,7 @@ export class FixedPriorityQueue<T>
         insertionPhysicalIndex = currentPhysicalIndex
         break
       }
-      currentPhysicalIndex++
+      ++currentPhysicalIndex
       if (currentPhysicalIndex === this.capacity) {
         currentPhysicalIndex = 0
       }
index 99fceb448341f256725087051fdc11f086144cbd..210ac186ef081e54bad0db4d3a6b5d0bde063062 100644 (file)
@@ -1449,7 +1449,7 @@ describe('Abstract pool test suite', () => {
     expect(elapsedTime).toBeGreaterThanOrEqual(2000)
     // Worker kill message response timeout is 1000ms
     expect(elapsedTime).toBeLessThanOrEqual(
-      tasksFinishedTimeout + 1000 * tasksFinished + 800
+      tasksFinishedTimeout + 1000 * tasksFinished + 1000
     )
   })
 
@@ -1480,7 +1480,7 @@ describe('Abstract pool test suite', () => {
     expect(tasksFinished).toBe(0)
     // Worker kill message response timeout is 1000ms
     expect(elapsedTime).toBeLessThanOrEqual(
-      tasksFinishedTimeout + 1000 * tasksFinished + 800
+      tasksFinishedTimeout + 1000 * tasksFinished + 1000
     )
   })