Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmark: fixing http_server_for_chunky_client.js #33271

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
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