From 7dff3685102f38af8445f9eb653885ae074995e1 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Tue, 22 Sep 2015 17:06:22 -0400 Subject: [PATCH] test: bp fix for test-http-get-pipeline-problem.js backport fix for test-http-get-pipeline-problem.js from master to 0.12.X. We've been seeing an intermittent failure in runs for zLinux with SLES 12. We confirmed that this fix resolves the issue so would like it in 0.12.X The original commit does not apply cleanly as the paths were changed, but the actual change is identical. The original commit was: https://github.com/nodejs/node/commit/3ba4f71fc4a1b3acdcaaa250bc5ba81442257e09 --- test/simple/test-http-get-pipeline-problem.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/simple/test-http-get-pipeline-problem.js b/test/simple/test-http-get-pipeline-problem.js index 720ce4b89c857b..c3a07ea0e25813 100644 --- a/test/simple/test-http-get-pipeline-problem.js +++ b/test/simple/test-http-get-pipeline-problem.js @@ -68,12 +68,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) {