From 864775812e4b2d6e05a15ee8f91283c601b171cd Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 17 Jun 2015 22:14:22 -0700 Subject: [PATCH] test: check result as early as possible --- test/parallel/test-http-get-pipeline-problem.js | 6 ++---- 1 file 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 069658cf3f474b..4f0d52aad5195d 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) {