From 82dfd2e392d666ca131b8bd678f0b1b1695852e6 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Thu, 11 Jan 2024 15:15:14 -0800 Subject: [PATCH] test: lock Node.js v18 testing to v18.18.2 as a workaround for IITM double-import issue (#3824) (backport of #3783) In Nodejs v18.19.0 ESM module loading was moved to being off-thread (a backport from Node.js v20, https://github.com/nodejs/node/pull/44710). This breaks current import-in-the-middle usage, resulting in ESM modules being double-loaded when the IITM hook is active (once on the loader worker thread, and then again later on the main thread). This change is a workaround to skip testing recent Node.js v18 versions until the IITM issue is resolved. Refs: #3784 --- .ci/tav.json | 73 ++++++++++++++++--------------- .github/workflows/tav-command.yml | 3 +- .github/workflows/tav.yml | 3 +- .github/workflows/test.yml | 2 +- CHANGELOG.asciidoc | 5 +++ dev-utils/lint-tav-json.js | 3 +- 6 files changed, 49 insertions(+), 40 deletions(-) diff --git a/.ci/tav.json b/.ci/tav.json index 15b2ec2bf0..5a0e50e610 100644 --- a/.ci/tav.json +++ b/.ci/tav.json @@ -1,42 +1,43 @@ { - "versions": [ 20, 18, 16, 14, 12, 10, 8 ], + "// versions": "Skip >=18.19.0 until IITM double-import issue is resolved.", + "versions": [ "20", "18.18.2", "16", "14", "12", "10", "8" ], "// modules": [ - "List of instrumented modules with the min Node version supported.", - "minVersion for each module should be kept in sync with .tav.yml" + "List of instrumented modules with the minimum Node major version supported.", + "minMajorVersion for each module should be kept in sync with .tav.yml" ], "modules": [ - { "name": "@apollo/server", "minVersion": 14 }, - { "name": "@aws-sdk/client-s3", "minVersion": 14 }, - { "name": "@elastic/elasticsearch", "minVersion": 10 }, - { "name": "@hapi/hapi", "minVersion": 8 }, - { "name": "@opentelemetry/api", "minVersion": 14 }, - { "name": "@opentelemetry/sdk-metrics", "minVersion": 14 }, - { "name": "apollo-server-express", "minVersion": 8 }, - { "name": "aws-sdk", "minVersion": 8 }, - { "name": "cassandra-driver", "minVersion": 8 }, - { "name": "elasticsearch", "minVersion": 8 }, - { "name": "express", "minVersion": 8 }, - { "name": "express-queue", "minVersion": 8 }, - { "name": "fastify", "minVersion": 8 }, - { "name": "finalhandler", "minVersion": 8 }, - { "name": "generic-pool", "minVersion": 8 }, - { "name": "graphql", "minVersion": 8 }, - { "name": "ioredis", "minVersion": 8 }, - { "name": "knex", "minVersion": 8 }, - { "name": "memcached", "minVersion": 8 }, - { "name": "mongodb", "minVersion": 8 }, - { "name": "mongodb-core", "minVersion": 8 }, - { "name": "mysql", "minVersion": 8 }, - { "name": "mysql2", "minVersion": 8 }, - { "name": "next", "minVersion": 14 }, - { "name": "pg", "minVersion": 8 }, - { "name": "redis", "minVersion": 8 }, - { "name": "restify", "minVersion": 14 }, - { "name": "tedious", "minVersion": 8 }, - { "name": "undici", "minVersion": 8 }, - { "name": "ws", "minVersion": 8 }, - { "name": "@koa/router,koa-router", "minVersion": 8 }, - { "name": "handlebars,pug", "minVersion": 8 }, - { "name": "bluebird,got", "minVersion": 8 } + { "name": "@apollo/server", "minMajorVersion": 14 }, + { "name": "@aws-sdk/client-s3", "minMajorVersion": 14 }, + { "name": "@elastic/elasticsearch", "minMajorVersion": 10 }, + { "name": "@hapi/hapi", "minMajorVersion": 8 }, + { "name": "@opentelemetry/api", "minMajorVersion": 14 }, + { "name": "@opentelemetry/sdk-metrics", "minMajorVersion": 14 }, + { "name": "apollo-server-express", "minMajorVersion": 8 }, + { "name": "aws-sdk", "minMajorVersion": 8 }, + { "name": "cassandra-driver", "minMajorVersion": 8 }, + { "name": "elasticsearch", "minMajorVersion": 8 }, + { "name": "express", "minMajorVersion": 8 }, + { "name": "express-queue", "minMajorVersion": 8 }, + { "name": "fastify", "minMajorVersion": 8 }, + { "name": "finalhandler", "minMajorVersion": 8 }, + { "name": "generic-pool", "minMajorVersion": 8 }, + { "name": "graphql", "minMajorVersion": 8 }, + { "name": "ioredis", "minMajorVersion": 8 }, + { "name": "knex", "minMajorVersion": 8 }, + { "name": "memcached", "minMajorVersion": 8 }, + { "name": "mongodb", "minMajorVersion": 8 }, + { "name": "mongodb-core", "minMajorVersion": 8 }, + { "name": "mysql", "minMajorVersion": 8 }, + { "name": "mysql2", "minMajorVersion": 8 }, + { "name": "next", "minMajorVersion": 14 }, + { "name": "pg", "minMajorVersion": 8 }, + { "name": "redis", "minMajorVersion": 8 }, + { "name": "restify", "minMajorVersion": 14 }, + { "name": "tedious", "minMajorVersion": 8 }, + { "name": "undici", "minMajorVersion": 8 }, + { "name": "ws", "minMajorVersion": 8 }, + { "name": "@koa/router,koa-router", "minMajorVersion": 8 }, + { "name": "handlebars,pug", "minMajorVersion": 8 }, + { "name": "bluebird,got", "minMajorVersion": 8 } ] } diff --git a/.github/workflows/tav-command.yml b/.github/workflows/tav-command.yml index 9d43bcf4e4..ae7d010c26 100644 --- a/.github/workflows/tav-command.yml +++ b/.github/workflows/tav-command.yml @@ -66,7 +66,8 @@ jobs: const permutations = [] for (const mod of mods) { for (const nv of vers) { - if (mod.minVersion && nv >= mod.minVersion) { + const nvMajor = Number(nv.split('.')[0]); + if (mod.minMajorVersion && nvMajor >= mod.minMajorVersion) { permutations.push(`${mod.name} ${nv}`) } } diff --git a/.github/workflows/tav.yml b/.github/workflows/tav.yml index f4a9c07d6b..98eb128190 100644 --- a/.github/workflows/tav.yml +++ b/.github/workflows/tav.yml @@ -45,7 +45,8 @@ jobs: const permutations = [] for (const mod of matrix.modules) { for (const nv of matrix.versions) { - if (mod.minVersion && nv >= mod.minVersion) { + const nvMajor = Number(nv.split('.')[0]) + if (mod.minMajorVersion && nvMajor >= mod.minMajorVersion) { permutations.push(`${mod.name} ${nv}`) } } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 29c11fbd3b..263b393b61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -127,7 +127,7 @@ jobs: matrix: node: - '20' - - '18' + - '18.18.2' # Skip >=18.19.0 until IITM double-import issue is resolved. - '18.0' - '16' - '16.0' diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 8e38b2b3cf..b540c7d5a4 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -40,6 +40,11 @@ for the latest (4.x) releases. The 3.x branch will be maintained until [[release-notes-3.50.0]] ==== 3.50.0 - 2023/09/07 +*Known issue*: Using the APM agent's <> with Node v18.19.0 is currently +not supported. Earlier versions of Node.js v18 and Node.js v20 and later +*are* supported. See +for details. + [float] ===== Features diff --git a/dev-utils/lint-tav-json.js b/dev-utils/lint-tav-json.js index f990cccb27..ddd7bf2681 100755 --- a/dev-utils/lint-tav-json.js +++ b/dev-utils/lint-tav-json.js @@ -59,7 +59,8 @@ function main(argv) { moduleNamesFromJson.add(moduleName); }); for (const nv of tavJson.versions) { - if (mod.minVersion && nv >= mod.minVersion) { + const nvMajor = Number(nv.split('.')[0]); + if (mod.minMajorVersion && nvMajor >= mod.minMajorVersion) { matrix.push(`${mod.name} ${nv}`); } }