Skip to content

Commit

Permalink
test: check result as early as possible
Browse files Browse the repository at this point in the history
PR-URL: #2007
Reviewed-By: Rod Vagg <rod@vagg.org>
  • Loading branch information
Trott committed Jun 20, 2015
1 parent 8ac5081 commit 3ba4f71
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/parallel/test-http-get-pipeline-problem.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ server.listen(common.PORT, function() {
var s = fs.createWriteStream(common.tmpDir + '/' + x + '.jpg');
res.pipe(s);

// TODO there should be a callback to pipe() that will allow
// us to get a callback when the pipe is finished.
res.on('end', function() {
s.on('finish', function() {
console.error('done ' + x);
if (++responses == total) {
s.on('close', checkFiles);
checkFiles();
}
});
}).on('error', function(e) {
Expand Down

0 comments on commit 3ba4f71

Please sign in to comment.