mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
benchmark: fixing http_server_for_chunky_client.js
PR-URL: https://github.com/nodejs/node/pull/33271 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
1 parent
b3f14df485
commit
6af15ebf22
1 file changed
+8
-2
@@ -10,7 +10,9 @@ process.env.PIPE_NAME = PIPE;
|
|||||||
|
|
||||||
tmpdir.refresh();
|
tmpdir.refresh();
|
||||||
|
|
||||||
const server = http.createServer((req, res) => {
|
// For Node.js versions below v13.3.0 this benchmark will require
|
||||||
|
// the flag --max-http-header-size 64000 in order to work properly
|
||||||
|
const server = http.createServer({ maxHeaderSize: 64000 }, (req, res) => {
|
||||||
const headers = {
|
const headers = {
|
||||||
'content-type': 'text/plain',
|
'content-type': 'text/plain',
|
||||||
'content-length': '2'
|
'content-length': '2'
|
||||||
@@ -28,7 +30,11 @@ const child = fork(
|
|||||||
`${__dirname}/_chunky_http_client.js`,
|
`${__dirname}/_chunky_http_client.js`,
|
||||||
process.argv.slice(2)
|
process.argv.slice(2)
|
||||||
);
|
);
|
||||||
child.on('message', common.sendResult);
|
child.on('message', (data) => {
|
||||||
|
if (data.type === 'report') {
|
||||||
|
common.sendResult(data);
|
||||||
|
}
|
||||||
|
});
|
||||||
child.on('close', (code) => {
|
child.on('close', (code) => {
|
||||||
server.close();
|
server.close();
|
||||||
assert.strictEqual(code, 0);
|
assert.strictEqual(code, 0);
|
||||||
|
|||||||
Reference in new issue
Block a user