Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

tests: fix race in test-http-curl-chunk-problem #9301

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
5 changes: 4 additions & 1 deletion test/simple/test-http-curl-chunk-problem.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,16 @@ var server = http.createServer(function(req, res) {
res.write(data);
});

cat.stdout.on('end', function onStdoutEnd() {
res.end();
});

// End the response on exit (and log errors)
cat.on('exit', function(code) {
if (code !== 0) {
console.error('subprocess exited with code ' + code);
process.exit(1);
}
res.end();
});

});
Expand Down