Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fcc6d54
lib: return directly if udp socket close before lookup
theanarkh Mar 1, 2024
5034363
src: fix --disable-single-executable-application
joyeecheung Feb 19, 2024
e992af8
test: skip SEA tests when SEA generation fails
joyeecheung Feb 26, 2024
5908c12
doc: clarify Corepack threat model
aduh95 Mar 1, 2024
9d2c039
test: remove flaky designation
lpinca Mar 2, 2024
20e0ba3
doc,module: clarify hook chain execution sequence
JakobJingleheimer Mar 2, 2024
87d2acc
doc: fix actual result of example is different in events
deokjinkim Mar 2, 2024
fcf235d
doc: add policy for distribution
GeoffreyBooth Mar 3, 2024
9617adc
Revert "build: fix warning in cares under GN build"
lpinca Mar 3, 2024
4d99797
lib: make sure close net server
theanarkh Mar 3, 2024
67e8001
meta: bump actions/setup-node from 4.0.1 to 4.0.2
dependabot[bot] Mar 3, 2024
e476cb4
meta: bump actions/download-artifact from 4.1.1 to 4.1.3
dependabot[bot] Mar 3, 2024
015a157
meta: bump actions/cache from 4.0.0 to 4.0.1
dependabot[bot] Mar 3, 2024
42ca545
meta: bump codecov/codecov-action from 4.0.1 to 4.1.0
dependabot[bot] Mar 3, 2024
78f38a0
meta: bump actions/upload-artifact from 4.3.0 to 4.3.1
dependabot[bot] Mar 3, 2024
10aaabd
meta: bump github/codeql-action from 3.23.2 to 3.24.6
dependabot[bot] Mar 3, 2024
57ba8f5
test: fix flaky http-chunk-extensions-limit test
Ethan-Arrowood Mar 3, 2024
23c32ab
build: respect the `NODE` env variable in `Makefile`
aduh95 Mar 3, 2024
625c9e0
benchmark: update iterations of benchmark/domain/domain-fn-args.js
Mar 4, 2024
0dfe810
benchmark: update iterations of benchmark/async_hooks/async-local-
Mar 4, 2024
5864534
deps: update nghttp2 to 1.60.0
nodejs-github-bot Mar 5, 2024
fd86ea8
Revert "build: workaround for node-core-utils"
richardlau Mar 5, 2024
fff7f48
test: reduce flakiness of `test-runner-output`
aduh95 Mar 5, 2024
7ff3551
build: fix arm64 host cross-compilation in GN
zcbenz Feb 28, 2024
85aa6ca
Revert "test_runner: do not invoke after hook when test is empty"
cjihrig Mar 7, 2024
bee3b36
test: add regression test for test_runner after hook
cjihrig Mar 7, 2024
a48c9ca
stream: do not defer construction by one microtick
mcollina Mar 7, 2024
84c7e6f
2024-03-08, Version 21.7.1 (Current)
targos Mar 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: fix flaky http-chunk-extensions-limit test
Replace the setInterval with a queueMicrotask to make test less flaky.

Fixes: #51883
PR-URL: #51943
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
  • Loading branch information
Ethan-Arrowood authored and targos committed Mar 7, 2024
commit 57ba8f5acb8ecca1388c484e1c4c9f39edd961c8
55 changes: 30 additions & 25 deletions test/parallel/test-http-chunk-extensions-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ const http = require('http');
const net = require('net');
const assert = require('assert');

// The maximum http chunk extension size is set in `src/node_http_parser.cc`.
// These tests assert that once the extension size is reached, an HTTP 413
// response is returned.
// Currently, the max size is set to 16KiB (16384).

// Verify that chunk extensions are limited in size when sent all together.
{
const server = http.createServer((req, res) => {
Expand All @@ -17,7 +22,8 @@ const assert = require('assert');
});

server.listen(0, () => {
const sock = net.connect(server.address().port);
const port = server.address().port;
const sock = net.connect(port);
let data = '';

sock.on('data', (chunk) => data += chunk.toString('utf-8'));
Expand All @@ -29,15 +35,17 @@ const assert = require('assert');

sock.end('' +
'GET / HTTP/1.1\r\n' +
'Host: localhost:8080\r\n' +
`Host: localhost:${port}\r\n` +
'Transfer-Encoding: chunked\r\n\r\n' +
'2;' + 'A'.repeat(20000) + '=bar\r\nAA\r\n' +
'0\r\n\r\n'
'2;' + 'a'.repeat(17000) + '\r\n' + // Chunk size + chunk ext + CRLF
'AA\r\n' + // Chunk data
'0\r\n' + // Last chunk
'\r\n' // End of http message
);
});
}

// Verify that chunk extensions are limited in size when sent in intervals.
// Verify that chunk extensions are limited in size when sent in parts
{
const server = http.createServer((req, res) => {
req.on('end', () => {
Expand All @@ -49,24 +57,10 @@ const assert = require('assert');
});

server.listen(0, () => {
const sock = net.connect(server.address().port);
let remaining = 20000;
const port = server.address().port;
const sock = net.connect(port);
let data = '';

const interval = setInterval(
() => {
if (remaining > 0) {
sock.write('A'.repeat(1000));
} else {
sock.write('=bar\r\nAA\r\n0\r\n\r\n');
clearInterval(interval);
}

remaining -= 1000;
},
common.platformTimeout(20),
).unref();

sock.on('data', (chunk) => data += chunk.toString('utf-8'));

sock.on('end', common.mustCall(function() {
Expand All @@ -76,10 +70,20 @@ const assert = require('assert');

sock.write('' +
'GET / HTTP/1.1\r\n' +
'Host: localhost:8080\r\n' +
`Host: localhost:${port}\r\n` +
'Transfer-Encoding: chunked\r\n\r\n' +
'2;'
'2;' // Chunk size + start of chunk-extension
);

sock.write('A'.repeat(8500)); // Write half of the chunk-extension

queueMicrotask(() => {
sock.write('A'.repeat(8500) + '\r\n' + // Remaining half of the chunk-extension
'AA\r\n' + // Chunk data
'0\r\n' + // Last chunk
'\r\n' // End of http message
);
});
});
}

Expand All @@ -95,7 +99,8 @@ const assert = require('assert');
});

server.listen(0, () => {
const sock = net.connect(server.address().port);
const port = server.address().port;
const sock = net.connect(port);
let data = '';

sock.on('data', (chunk) => data += chunk.toString('utf-8'));
Expand All @@ -120,7 +125,7 @@ const assert = require('assert');

sock.end('' +
'GET / HTTP/1.1\r\n' +
'Host: localhost:8080\r\n' +
`Host: localhost:${port}\r\n` +
'Transfer-Encoding: chunked\r\n\r\n' +
'2;' + 'A'.repeat(10000) + '=bar\r\nAA\r\n' +
'2;' + 'A'.repeat(10000) + '=bar\r\nAA\r\n' +
Expand Down