From 7652db4b9483e937712413ff59c73c5f3ab63836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 19 Jun 2024 14:44:35 +0200 Subject: [PATCH] fix the _a.destroy test flakiness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .changeset/gentle-avocados-obey.md | 5 +++ .github/workflows/ci.yml | 27 +------------- ...-interceptors-npm-0.17.10-c1199a9424.patch | 18 ---------- ...s-interceptors-npm-0.29.1-b5be72ad54.patch | 36 ------------------- package.json | 2 -- yarn.lock | 34 ++---------------- 6 files changed, 8 insertions(+), 114 deletions(-) create mode 100644 .changeset/gentle-avocados-obey.md delete mode 100644 .yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch delete mode 100644 .yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch diff --git a/.changeset/gentle-avocados-obey.md b/.changeset/gentle-avocados-obey.md new file mode 100644 index 0000000000..80bf5f89c7 --- /dev/null +++ b/.changeset/gentle-avocados-obey.md @@ -0,0 +1,5 @@ +--- +'@backstage/cli': patch +--- + +Only bootstrap global-agent if it's actually being used diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 95d6bbee34..135076ba40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,32 +150,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: - [ - 18.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - 20.x, - ] + node-version: [18.x, 20.x] name: Test ${{ matrix.node-version }} services: diff --git a/.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch b/.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch deleted file mode 100644 index 3b6e9c1fbf..0000000000 --- a/.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/lib/interceptors/ClientRequest/NodeClientRequest.js b/lib/interceptors/ClientRequest/NodeClientRequest.js -index 9bcc5a6adfd3c84541d686c3d0039f5e79dd34f5..f72d47b02a437eaefead4ec1543a0dd70dd1bb6f 100644 ---- a/lib/interceptors/ClientRequest/NodeClientRequest.js -+++ b/lib/interceptors/ClientRequest/NodeClientRequest.js -@@ -382,6 +382,13 @@ var NodeClientRequest = /** @class */ (function (_super) { - */ - NodeClientRequest.prototype.terminate = function () { - var _a; -+ const tempAgent = this.agent; -+ if (tempAgent && typeof tempAgent === 'object' && typeof tempAgent.destroy !== 'function') { -+ console.log( -+ `No agent to destroy, found '${typeof tempAgent}'->'${typeof tempAgent.destroy}':`, -+ tempAgent -+ ); -+ } - // @ts-ignore - (_a = this.agent) === null || _a === void 0 ? void 0 : _a.destroy(); - }; diff --git a/.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch b/.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch deleted file mode 100644 index 946777f134..0000000000 --- a/.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/lib/node/chunk-CVV3L375.mjs b/lib/node/chunk-CVV3L375.mjs -index c37d61d709235efebe4ea19703a901bfbc05c9e3..4085c9b33075e18f7e4e3ad82fdd3fa5f6bb31e2 100644 ---- a/lib/node/chunk-CVV3L375.mjs -+++ b/lib/node/chunk-CVV3L375.mjs -@@ -540,6 +540,13 @@ var _NodeClientRequest = class extends ClientRequest { - * Terminates a pending request. - */ - terminate() { -+ const tempAgent = this.agent; -+ if (tempAgent && typeof tempAgent === 'object' && typeof tempAgent.destroy !== 'function') { -+ console.log( -+ `No agent to destroy, found '${typeof tempAgent}'->'${typeof tempAgent.destroy}':`, -+ tempAgent -+ ); -+ } - var _a; - (_a = this.agent) == null ? void 0 : _a.destroy(); - } -diff --git a/lib/node/chunk-SXGRMPXP.js b/lib/node/chunk-SXGRMPXP.js -index a5129f18a9b754acf2bfb3b1545df2378b01a95a..8228b6d4f649937559f45aefbdb8c8df275c5285 100644 ---- a/lib/node/chunk-SXGRMPXP.js -+++ b/lib/node/chunk-SXGRMPXP.js -@@ -540,6 +540,13 @@ var _NodeClientRequest = class extends _http.ClientRequest { - * Terminates a pending request. - */ - terminate() { -+ const tempAgent = this.agent; -+ if (tempAgent && typeof tempAgent === 'object' && typeof tempAgent.destroy !== 'function') { -+ console.log( -+ `No agent to destroy, found '${typeof tempAgent}'->'${typeof tempAgent.destroy}':`, -+ tempAgent -+ ); -+ } - var _a; - (_a = this.agent) == null ? void 0 : _a.destroy(); - } diff --git a/package.json b/package.json index 47dad4b2a2..59150dedc9 100644 --- a/package.json +++ b/package.json @@ -87,8 +87,6 @@ "@changesets/assemble-release-plan@^6.0.0": "patch:@changesets/assemble-release-plan@npm%3A6.0.0#./.yarn/patches/@changesets-assemble-release-plan-npm-6.0.0-f7b3005037.patch", "@material-ui/pickers@^3.2.10": "patch:@material-ui/pickers@npm%3A3.3.11#./.yarn/patches/@material-ui-pickers-npm-3.3.11-1c8f68ea20.patch", "@material-ui/pickers@^3.3.10": "patch:@material-ui/pickers@npm%3A3.3.11#./.yarn/patches/@material-ui-pickers-npm-3.3.11-1c8f68ea20.patch", - "@mswjs/interceptors@^0.17.10": "patch:@mswjs/interceptors@npm%3A0.17.10#.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch", - "@mswjs/interceptors@^0.29.0": "patch:@mswjs/interceptors@npm%3A0.29.1#./.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch", "@types/react": "^18", "@types/react-dom": "^18", "jest-haste-map@^29.7.0": "patch:jest-haste-map@npm%3A29.7.0#./.yarn/patches/jest-haste-map-npm-29.7.0-e3be419eff.patch" diff --git a/yarn.lock b/yarn.lock index 2b8090e00d..dd05b8d157 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10782,7 +10782,7 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:0.17.10": +"@mswjs/interceptors@npm:^0.17.10": version: 0.17.10 resolution: "@mswjs/interceptors@npm:0.17.10" dependencies: @@ -10798,7 +10798,7 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@npm:0.29.1": +"@mswjs/interceptors@npm:^0.29.0": version: 0.29.1 resolution: "@mswjs/interceptors@npm:0.29.1" dependencies: @@ -10812,36 +10812,6 @@ __metadata: languageName: node linkType: hard -"@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.17.10#.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch::locator=root%40workspace%3A.": - version: 0.17.10 - resolution: "@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.17.10#.yarn/patches/@mswjs-interceptors-npm-0.17.10-c1199a9424.patch::version=0.17.10&hash=652df3&locator=root%40workspace%3A." - dependencies: - "@open-draft/until": ^1.0.3 - "@types/debug": ^4.1.7 - "@xmldom/xmldom": ^0.8.3 - debug: ^4.3.3 - headers-polyfill: 3.2.5 - outvariant: ^1.2.1 - strict-event-emitter: ^0.2.4 - web-encoding: ^1.1.5 - checksum: 32ca2f2d4e8bc46e1f773ca440a0ec5ba9c69ea4d89c07fbd25a0fde73627a232eb7d0cf3ce426fbe1fd58863ab9c84386352ecdc55eeb2a5240ba126c0ba6f0 - languageName: node - linkType: hard - -"@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.29.1#./.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch::locator=root%40workspace%3A.": - version: 0.29.1 - resolution: "@mswjs/interceptors@patch:@mswjs/interceptors@npm%3A0.29.1#./.yarn/patches/@mswjs-interceptors-npm-0.29.1-b5be72ad54.patch::version=0.29.1&hash=d6ea98&locator=root%40workspace%3A." - dependencies: - "@open-draft/deferred-promise": ^2.2.0 - "@open-draft/logger": ^0.3.0 - "@open-draft/until": ^2.0.0 - is-node-process: ^1.2.0 - outvariant: ^1.2.1 - strict-event-emitter: ^0.5.1 - checksum: d7ce191736c8b5df2dcdb36d11dbf25ca37cd3c0d1319cf8594713c443c5bdf733c2aeb4863aba646a67b50813e64dc1b13fbd31cee238cc4c9f8a8fd2908486 - languageName: node - linkType: hard - "@mui/base@npm:5.0.0-beta.40": version: 5.0.0-beta.40 resolution: "@mui/base@npm:5.0.0-beta.40"