Skip to content

Commit 3ba4f71

Browse files
committed
test: check result as early as possible
PR-URL: #2007 Reviewed-By: Rod Vagg <[email protected]>
1 parent 8ac5081 commit 3ba4f71

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/parallel/test-http-get-pipeline-problem.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ server.listen(common.PORT, function() {
4747
var s = fs.createWriteStream(common.tmpDir + '/' + x + '.jpg');
4848
res.pipe(s);
4949

50-
// TODO there should be a callback to pipe() that will allow
51-
// us to get a callback when the pipe is finished.
52-
res.on('end', function() {
50+
s.on('finish', function() {
5351
console.error('done ' + x);
5452
if (++responses == total) {
55-
s.on('close', checkFiles);
53+
checkFiles();
5654
}
5755
});
5856
}).on('error', function(e) {

0 commit comments

Comments
 (0)