summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2015-06-17 22:14:22 -0700
committerRich Trott <rtrott@gmail.com>2015-06-19 22:34:54 -0700
commit3ba4f71fc4a1b3acdcaaa250bc5ba81442257e09 (patch)
tree7428ecdd6ca95a8be9518dd7c8dd1f7c0c525f9f
parent8ac50819b69f962c13f9b436e0c7c5488276a6fd (diff)
downloadnodejs-3ba4f71fc4a1b3acdcaaa250bc5ba81442257e09.tar.gz
nodejs-3ba4f71fc4a1b3acdcaaa250bc5ba81442257e09.tar.bz2
nodejs-3ba4f71fc4a1b3acdcaaa250bc5ba81442257e09.zip
test: check result as early as possible
PR-URL: https://github.com/nodejs/io.js/pull/2007 Reviewed-By: Rod Vagg <rod@vagg.org>
-rw-r--r--test/parallel/test-http-get-pipeline-problem.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/test/parallel/test-http-get-pipeline-problem.js b/test/parallel/test-http-get-pipeline-problem.js
index 069658cf3..4f0d52aad 100644
--- a/test/parallel/test-http-get-pipeline-problem.js
+++ b/test/parallel/test-http-get-pipeline-problem.js
@@ -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) {