build(ci): skip tests on node.hs 16.x
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 20 Sep 2023 16:58:50 +0000 (18:58 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Wed, 20 Sep 2023 16:58:50 +0000 (18:58 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
.github/workflows/ci.yml
src/pools/abstract-pool.ts

index 3419c5719e142d55a15ef939083623bd3cc4fa26..7490cda32ccf3af9a67c1e05460ed348c194a4ab 100644 (file)
@@ -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
index 88e5fe79e782b06cbf507c794ab85c54d1bceaa9..4fe0c0388d898adae0222e281e4fb70eb66a4c82 100644 (file)
@@ -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<Response>): void {
+  private checkMessageWorkerId (message: MessageValue<Data | Response>): 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
       )