From: Jérôme Benoit Date: Wed, 20 Sep 2023 16:58:50 +0000 (+0200) Subject: build(ci): skip tests on node.hs 16.x X-Git-Tag: v2.7.1~7 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4d1591674092004fa1d05601285c291a04516e87;p=poolifier.git build(ci): skip tests on node.hs 16.x Signed-off-by: Jérôme Benoit --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3419c571..7490cda3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,7 @@ jobs: run: pnpm lint - name: Tests + if: ${{ matrix.os != 'windows-latest' && matrix.node != '16.x' }} run: pnpm test - name: Coverage Report diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 88e5fe79..4fe0c038 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -30,12 +30,12 @@ import { PoolTypes, type TasksQueueOptions } from './pool' -import { - type IWorker, - type IWorkerNode, - type WorkerInfo, - type WorkerType, - type WorkerUsage +import type { + IWorker, + IWorkerNode, + WorkerInfo, + WorkerType, + WorkerUsage } from './worker' import { type MeasurementStatisticsRequirements, @@ -485,7 +485,7 @@ export abstract class AbstractPool< * @param message - The received message. * @throws {@link https://nodejs.org/api/errors.html#class-error} If the worker id is invalid. */ - private checkMessageWorkerId (message: MessageValue): void { + private checkMessageWorkerId (message: MessageValue): void { if (message.workerId == null) { throw new Error('Worker message received without worker id') } else if ( @@ -1243,6 +1243,7 @@ export abstract class AbstractPool< protected createAndSetupDynamicWorkerNode (): number { const workerNodeKey = this.createAndSetupWorkerNode() this.registerWorkerMessageListener(workerNodeKey, message => { + this.checkMessageWorkerId(message) const localWorkerNodeKey = this.getWorkerNodeKeyByWorkerId( message.workerId )