From 34e1186a394d964c1ee8028b4af84df44f99093e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 09:50:48 +0000 Subject: [PATCH 1/3] fix(deps): update dependency undici to v8 --- package.json | 2 +- pnpm-lock.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index cd2e3c18..543f3065 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "mime-types": "^2.1.35", "qs": "^6.15.0", "type-fest": "^4.41.0", - "undici": "^7.24.0", + "undici": "^8.0.0", "ylru": "^2.0.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 55c0a726..520d2978 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,8 +28,8 @@ importers: specifier: ^4.41.0 version: 4.41.0 undici: - specifier: ^7.24.0 - version: 7.24.6 + specifier: ^8.0.0 + version: 8.0.1 ylru: specifier: ^2.0.0 version: 2.0.0 @@ -1557,9 +1557,9 @@ packages: undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} - undici@7.24.6: - resolution: {integrity: sha512-Xi4agocCbRzt0yYMZGMA6ApD7gvtUFaxm4ZmeacWI4cZxaF6C+8I8QfofC20NAePiB/IcvZmzkJ7XPa471AEtA==} - engines: {node: '>=20.18.1'} + undici@8.0.1: + resolution: {integrity: sha512-6qdTUr+jabXmYKeYkv/+pIvO7d0bs1k9uy+5PFnXr4segNVwILH1KExhwRh3/iGa6gSLmySK3hTnSs3k7ZPnjQ==} + engines: {node: '>=22.19.0'} unicode-emoji-modifier-base@1.0.0: resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} @@ -2862,7 +2862,7 @@ snapshots: undici-types@6.21.0: {} - undici@7.24.6: {} + undici@8.0.1: {} unicode-emoji-modifier-base@1.0.0: {} From da2f3beeca6d570bd29d6edfca0bcd2cc528e91d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 12:49:31 +0000 Subject: [PATCH 2/3] fix: close all proxy connections before closing server in test afterAll In undici v8, ProxyAgent defaults proxyTunnel to true, which means CONNECT tunneling is used even for HTTP-to-HTTP proxy requests. These tunnel connections keep the proxy server alive, preventing proxyServer.close() from completing within the 10s afterAll timeout. Adding proxyServer.closeAllConnections() before proxyServer.close() forcefully terminates the tunnel connections and allows cleanup. Agent-Logs-Url: https://github.com/node-modules/urllib/sessions/4c3edcc4-7c2f-4451-b8f8-b324a333958d Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- test/options.dispatcher.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/options.dispatcher.test.ts b/test/options.dispatcher.test.ts index e737afc0..b76d928e 100644 --- a/test/options.dispatcher.test.ts +++ b/test/options.dispatcher.test.ts @@ -27,6 +27,7 @@ describe('options.dispatcher.test.ts', () => { afterAll(async () => { await close(); + proxyServer.closeAllConnections(); await new Promise((resolve) => { proxyServer.close(resolve); }); From a54db5c474379f0d190ebeb8ff7af7754fc86cdf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 14:48:08 +0000 Subject: [PATCH 3/3] fix: close ProxyAgent and Agent dispatchers in test to prevent afterAll timeout In undici v8, ProxyAgent and Agent maintain persistent connections (especially H2 connections) that keep the proxy server's CONNECT tunnels alive. Close all dispatcher instances at the end of each test to allow clean proxy server shutdown within the afterAll timeout. Agent-Logs-Url: https://github.com/node-modules/urllib/sessions/bcba591d-864f-4402-8861-c5be26f032ba Co-authored-by: fengmk2 <156269+fengmk2@users.noreply.github.com> --- test/options.dispatcher.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/options.dispatcher.test.ts b/test/options.dispatcher.test.ts index b76d928e..18b7b4da 100644 --- a/test/options.dispatcher.test.ts +++ b/test/options.dispatcher.test.ts @@ -51,6 +51,7 @@ describe('options.dispatcher.test.ts', () => { // console.log(response2.status, response2.headers); assert.equal(response2.status, 200); assert.equal(response2.data.name, 'urllib'); + await proxyAgent.close(); }); it('should work with getGlobalDispatcher() dispatcher', async () => { @@ -64,6 +65,7 @@ describe('options.dispatcher.test.ts', () => { assert.equal(response.status, 200); assert.equal(response.data, '