From 461bf36d701f3f7c669e2d916d5a5bc17fc447bf Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Fri, 7 Jun 2019 14:20:43 +0200 Subject: [PATCH] http: fix test where aborted should not be emitted PR-URL: https://github.com/nodejs/node/pull/20077 Fixes: https://github.com/nodejs/node/issues/20107 Reviewed-By: James M Snell Reviewed-By: Matteo Collina --- doc/api/http.md | 5 ++-- lib/_http_client.js | 16 +++++++++---- test/parallel/test-http-client-aborted.js | 23 +++++++++++++++++++ ...test-http-client-no-error-after-aborted.js | 21 +++++++++++++++++ .../test-http-client-timeout-on-connect.js | 3 +-- .../test-http-writable-true-after-close.js | 2 +- 6 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 test/parallel/test-http-client-aborted.js create mode 100644 test/parallel/test-http-client-no-error-after-aborted.js diff --git a/doc/api/http.md b/doc/api/http.md index cc0c7ae1ce4917..e9ed20f05f775f 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -541,7 +541,8 @@ added: v0.3.8 --> Marks the request as aborting. Calling this will cause remaining data -in the response to be dropped and the socket to be destroyed. +in the response to be dropped and the socket to be destroyed. After +calling this method no further errors will be emitted. ### request.aborted