Skip to content

Commit

Permalink
benchmark: fixing http_server_for_chunky_client.js
Browse files Browse the repository at this point in the history
PR-URL: #33271
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
edsadr authored and codebytere committed Jul 8, 2020
1 parent 6133639 commit 09277fa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions benchmark/http/http_server_for_chunky_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ process.env.PIPE_NAME = PIPE;

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 = {
'content-type': 'text/plain',
'content-length': '2'
Expand All @@ -28,7 +30,11 @@ const child = fork(
`${__dirname}/_chunky_http_client.js`,
process.argv.slice(2)
);
child.on('message', common.sendResult);
child.on('message', (data) => {
if (data.type === 'report') {
common.sendResult(data);
}
});
child.on('close', (code) => {
server.close();
assert.strictEqual(code, 0);
Expand Down

0 comments on commit 09277fa

Please sign in to comment.