Skip to content

Commit

Permalink
chore(deps): update external fixes (#317)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
renovate[bot] and stefan-guggisberg authored Nov 7, 2022
1 parent a209c93 commit 9040d24
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 59 deletions.
32 changes: 16 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"prepare": "husky install"
},
"mocha": {
"timeout": "5000",
"timeout": "10000",
"recursive": "true",
"reporter": "mocha-multi-reporters",
"reporter-options": "configFile=.mocha-multi.json"
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/core/h2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
8 changes: 2 additions & 6 deletions test/core/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 3 additions & 9 deletions test/fetch/cache.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) => {
Expand Down
8 changes: 2 additions & 6 deletions test/fetch/index.http1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions test/fetch/index.http2.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
12 changes: 3 additions & 9 deletions test/fetch/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9040d24

Please sign in to comment.