Skip to content

Commit e576519

Browse files
committed
test: refine pool destroy time expectation
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
1 parent 85900ef commit e576519

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/queues/abstract-fixed-queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export abstract class AbstractFixedQueue<T> implements IFixedQueue<T> {
6666
logicalIndex = i
6767
break
6868
}
69-
currentPhysicalIndex++
69+
++currentPhysicalIndex
7070
if (currentPhysicalIndex === this.capacity) {
7171
currentPhysicalIndex = 0
7272
}

src/queues/fixed-priority-queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class FixedPriorityQueue<T> extends AbstractFixedQueue<T>
2222
insertionPhysicalIndex = currentPhysicalIndex
2323
break
2424
}
25-
currentPhysicalIndex++
25+
++currentPhysicalIndex
2626
if (currentPhysicalIndex === this.capacity) {
2727
currentPhysicalIndex = 0
2828
}

tests/pools/abstract-pool.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ describe({
14421442
expect(elapsedTime).toBeGreaterThanOrEqual(2000)
14431443
// Worker kill message response timeout is 1000ms
14441444
expect(elapsedTime).toBeLessThanOrEqual(
1445-
tasksFinishedTimeout + 1000 * tasksFinished + 100,
1445+
tasksFinishedTimeout + 1000 * tasksFinished + 200,
14461446
)
14471447
})
14481448

@@ -1473,7 +1473,7 @@ describe({
14731473
expect(tasksFinished).toBe(0)
14741474
// Worker kill message response timeout is 1000ms
14751475
expect(elapsedTime).toBeLessThanOrEqual(
1476-
tasksFinishedTimeout + 1000 * tasksFinished + 100,
1476+
tasksFinishedTimeout + 1000 * tasksFinished + 200,
14771477
)
14781478
})
14791479

0 commit comments

Comments
 (0)