From bc1cb7b7fccccdfcffd4748f2fc91fc3764b9219 Mon Sep 17 00:00:00 2001 From: Ouyang Yadong Date: Wed, 8 Aug 2018 10:51:16 +0800 Subject: [PATCH] test: handle errors correctly in GC http test In test-gc-http-client-timeout.js, res.resume is not a function if error occurs. Remove the error handler. PR-URL: https://github.com/nodejs/node/pull/22185 Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- test/parallel/test-gc-http-client-timeout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-gc-http-client-timeout.js b/test/parallel/test-gc-http-client-timeout.js index e6878021ef9b89..e5cb91c06f8911 100644 --- a/test/parallel/test-gc-http-client-timeout.js +++ b/test/parallel/test-gc-http-client-timeout.js @@ -39,7 +39,7 @@ function getall() { pathname: '/', port: server.address().port }, cb); - req.on('error', cb); + req.setTimeout(10, function() { console.log('timeout (expected)'); });