From 9040d249452d550db131451de060e54278bd82fa Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 15:48:35 +0100 Subject: [PATCH] chore(deps): update external fixes (#317) * chore(deps): update external fixes * test: debug flaky tests * test: debug flaky tests * test: debug flaky tests * test: debug flaky tests * test: debug flaky tests Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Stefan Guggisberg --- package-lock.json | 32 ++++++++++++++++---------------- package.json | 6 +++--- src/core/h2.js | 2 +- test/core/index.test.js | 8 ++------ test/fetch/cache.test.js | 12 +++--------- test/fetch/index.http1.test.js | 8 ++------ test/fetch/index.http2.test.js | 12 +++--------- test/fetch/index.test.js | 12 +++--------- 8 files changed, 33 insertions(+), 59 deletions(-) diff --git a/package-lock.json b/package-lock.json index 356bbc9..d79e277 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "@adobe/fetch", - "version": "3.2.1", + "version": "3.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@adobe/fetch", - "version": "3.2.1", + "version": "3.3.0", "license": "Apache-2.0", "dependencies": { "debug": "4.3.4", "http-cache-semantics": "4.1.0", - "lru-cache": "7.14.0" + "lru-cache": "7.14.1" }, "devDependencies": { "@semantic-release/changelog": "6.0.1", @@ -20,7 +20,7 @@ "chai-as-promised": "7.1.1", "chai-bytes": "0.1.2", "chai-iterator": "3.0.2", - "eslint": "8.26.0", + "eslint": "8.27.0", "eslint-config-airbnb-base": "15.0.0", "eslint-plugin-header": "3.1.1", "eslint-plugin-import": "2.26.0", @@ -2325,9 +2325,9 @@ } }, "node_modules/eslint": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", - "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", + "version": "8.27.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.27.0.tgz", + "integrity": "sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.3.3", @@ -4618,9 +4618,9 @@ } }, "node_modules/lru-cache": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.0.tgz", - "integrity": "sha512-EIRtP1GrSJny0dqb50QXRUNBxHJhcpxHC++M5tD7RYbvLLn5KVWKsbyswSSqDuU15UFi3bgTQIY8nhDMeF6aDQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.1.tgz", + "integrity": "sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==", "engines": { "node": ">=12" } @@ -11903,9 +11903,9 @@ "dev": true }, "eslint": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.26.0.tgz", - "integrity": "sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==", + "version": "8.27.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.27.0.tgz", + "integrity": "sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ==", "dev": true, "requires": { "@eslint/eslintrc": "^1.3.3", @@ -13589,9 +13589,9 @@ } }, "lru-cache": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.0.tgz", - "integrity": "sha512-EIRtP1GrSJny0dqb50QXRUNBxHJhcpxHC++M5tD7RYbvLLn5KVWKsbyswSSqDuU15UFi3bgTQIY8nhDMeF6aDQ==" + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.14.1.tgz", + "integrity": "sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==" }, "make-dir": { "version": "3.1.0", diff --git a/package.json b/package.json index 022738c..93a8af4 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "prepare": "husky install" }, "mocha": { - "timeout": "5000", + "timeout": "10000", "recursive": "true", "reporter": "mocha-multi-reporters", "reporter-options": "configFile=.mocha-multi.json" @@ -52,7 +52,7 @@ "dependencies": { "debug": "4.3.4", "http-cache-semantics": "4.1.0", - "lru-cache": "7.14.0" + "lru-cache": "7.14.1" }, "devDependencies": { "@semantic-release/changelog": "6.0.1", @@ -61,7 +61,7 @@ "chai-as-promised": "7.1.1", "chai-bytes": "0.1.2", "chai-iterator": "3.0.2", - "eslint": "8.26.0", + "eslint": "8.27.0", "eslint-config-airbnb-base": "15.0.0", "eslint-plugin-header": "3.1.1", "eslint-plugin-import": "2.26.0", diff --git a/src/core/h2.js b/src/core/h2.js index bf91c67..b0f098c 100644 --- a/src/core/h2.js +++ b/src/core/h2.js @@ -273,7 +273,7 @@ const request = async (ctx, url, options) => { req.once('error', (err) => { // error occured during the request session.off('error', onSessionError); - /* istanbul ignore else */ + /* istanbul ignore next */ if (signal) { signal.removeEventListener('abort', onAbortSignal); } diff --git a/test/core/index.test.js b/test/core/index.test.js index 7d544d8..a16c121 100644 --- a/test/core/index.test.js +++ b/test/core/index.test.js @@ -190,9 +190,7 @@ describe('Core Tests', () => { assert((ts1 - ts0) < 10); }); - it('AbortController works (slow response)', async function test() { - this.timeout(5000); - + it('AbortController works (slow response)', async () => { const controller = new AbortController(); setTimeout(() => controller.abort(), 1000); const { signal } = controller; @@ -564,9 +562,7 @@ describe('Core Tests', () => { } }); - it('HTTP/2 server push can be rejected', async function test() { - this.timeout(5000); - + it('HTTP/2 server push can be rejected', async () => { const pushPromiseHandler = (url, headers, reject) => { // we're not interested, cancel push promise reject(); diff --git a/test/fetch/cache.test.js b/test/fetch/cache.test.js index 5d28e2a..6b0308f 100644 --- a/test/fetch/cache.test.js +++ b/test/fetch/cache.test.js @@ -185,9 +185,7 @@ describe('Cache Tests', () => { await ctx.reset(); }); - it('fetch supports max-age directive', async function test() { - this.timeout(5000); - + it('fetch supports max-age directive', async () => { // max-age=3 seconds const url = 'https://httpbin.org/cache/3'; // send request @@ -341,9 +339,7 @@ describe('Cache Tests', () => { assert.deepStrictEqual(JSON.parse(await resp.text()), json); }); - it('fetch supports HTTP/2 server push', async function test() { - this.timeout(5000); - + it('fetch supports HTTP/2 server push', async () => { // returns a promise which resolves with the url of the pushed resource const receivedPush = () => new Promise((resolve) => { // eslint-disable-next-line no-unused-vars @@ -379,9 +375,7 @@ describe('Cache Tests', () => { } }); - it('test redundant server push', async function test() { - this.timeout(5000); - + it('test redundant server push', async () => { let pushedResponse; const receivedPush = () => new Promise((resolve) => { onPush((url, response) => { diff --git a/test/fetch/index.http1.test.js b/test/fetch/index.http1.test.js index a15d0d2..575a0cc 100644 --- a/test/fetch/index.http1.test.js +++ b/test/fetch/index.http1.test.js @@ -177,9 +177,7 @@ testParams.forEach((params) => { } }); - it(`concurrent HTTP/1.1 requests to same origin (${name})`, async function test() { - this.timeout(5000); - + it(`concurrent HTTP/1.1 requests to same origin (${name})`, async () => { const { fetch, reset } = context({ alpnProtocols: [ALPN_HTTP1_1] }); const N = 200; // # of parallel requests // httpbingo.org seems to be more stable than httpbin.org @@ -228,9 +226,7 @@ testParams.forEach((params) => { }); }); - it(`concurrent HTTP/1.1 requests to same origin using different contexts (${name})`, async function test() { - this.timeout(5000); - + it(`concurrent HTTP/1.1 requests to same origin using different contexts (${name})`, async () => { const doFetch = async (ctx, url) => ctx.fetch(url); const N = 50; // # of parallel requests diff --git a/test/fetch/index.http2.test.js b/test/fetch/index.http2.test.js index d7d8e4b..78c2fe1 100644 --- a/test/fetch/index.http2.test.js +++ b/test/fetch/index.http2.test.js @@ -101,9 +101,7 @@ describe('HTTP/2-specific Fetch Tests', () => { assert.strictEqual(+response.headers.get('content-length'), buf.length); }); - it('HTTP/2 server push can be disabled', async function test() { - this.timeout(5000); - + it('HTTP/2 server push can be disabled', async () => { const ctx = context({ h2: { enablePush: false } }); const handler = sinon.fake(); @@ -124,9 +122,7 @@ describe('HTTP/2-specific Fetch Tests', () => { } }); - it('concurrent HTTP/2 requests to same origin', async function test() { - this.timeout(5000); - + it('concurrent HTTP/2 requests to same origin', async () => { const N = 500; // # of parallel requests const TEST_URL = 'https://httpbin.org/bytes/'; // HTTP2 // generete array of 'randomized' urls @@ -160,9 +156,7 @@ describe('HTTP/2-specific Fetch Tests', () => { assert.notStrictEqual(results[1], results[2]); }); - it('concurrent HTTP/2 requests to same origin using different contexts', async function test() { - this.timeout(5000); - + it('concurrent HTTP/2 requests to same origin using different contexts', async () => { const doFetch = async (ctx, url) => ctx.fetch(url); const N = 50; // # of parallel requests diff --git a/test/fetch/index.test.js b/test/fetch/index.test.js index aceddf0..977e888 100644 --- a/test/fetch/index.test.js +++ b/test/fetch/index.test.js @@ -210,9 +210,7 @@ testParams.forEach((params) => { assert(body.destroyed); }); - it('timeoutSignal works (slow response)', async function test() { - this.timeout(5000); - + it('timeoutSignal works (slow response)', async () => { const signal = timeoutSignal(500); const method = 'POST'; @@ -232,9 +230,7 @@ testParams.forEach((params) => { assert(body.destroyed); }); - it('AbortController works (slow response)', async function test() { - this.timeout(5000); - + it('AbortController works (slow response)', async () => { const controller = new AbortController(); setTimeout(() => controller.abort(), 1000); const { signal } = controller; @@ -272,9 +268,7 @@ testParams.forEach((params) => { } }); - it('AbortController works (dripping response)', async function test() { - this.timeout(5000); - + it('AbortController works (dripping response)', async () => { const FETCH_TIMEOUT = 1000; // ms const DRIPPING_DURATION = 2; // seconds // doesn't support POST method