Skip to content

Commit

Permalink
tests: fix race in test-http-curl-chunk-problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Gilli committed Feb 27, 2015
1 parent d51f79e commit 7eaeddb
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit 7eaeddb

Please sign in to comment.