summaryrefslogtreecommitdiff
path: root/test/parallel/test-http2-respond-with-fd-errors.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-12-12 11:34:17 -0800
committerMyles Borins <mylesborins@google.com>2018-05-02 14:30:37 -0400
commitfc40b7de46f734bc41c4718570836b15b2ced9a0 (patch)
tree9bb75252239d17f47ee897889554e205da635e7f /test/parallel/test-http2-respond-with-fd-errors.js
parent1d65f2b879c0cfbc847a245eda2a54009e8a30f6 (diff)
downloadnode-new-fc40b7de46f734bc41c4718570836b15b2ced9a0.tar.gz
http2: cleanup Http2Stream/Http2Session destroy
Backport-PR-URL: https://github.com/nodejs/node/pull/18050 Backport-PR-URL: https://github.com/nodejs/node/pull/20456 PR-URL: https://github.com/nodejs/node/pull/17406 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> This is a significant cleanup and refactoring of the cleanup/close/destroy logic for Http2Stream and Http2Session. There are significant changes here in the timing and ordering of cleanup logic, JS apis. and various related necessary edits.
Diffstat (limited to 'test/parallel/test-http2-respond-with-fd-errors.js')
-rw-r--r--test/parallel/test-http2-respond-with-fd-errors.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/parallel/test-http2-respond-with-fd-errors.js b/test/parallel/test-http2-respond-with-fd-errors.js
index 1d32a2f45c..b7ff09225b 100644
--- a/test/parallel/test-http2-respond-with-fd-errors.js
+++ b/test/parallel/test-http2-respond-with-fd-errors.js
@@ -83,12 +83,18 @@ function runTest(test) {
const client = http2.connect(url);
const req = client.request(headers);
+ req.on('error', common.expectsError({
+ code: 'ERR_HTTP2_STREAM_ERROR',
+ type: Error,
+ message: 'Stream closed with error code 2'
+ }));
+
currentError = test;
req.resume();
req.end();
req.on('end', common.mustCall(() => {
- client.destroy();
+ client.close();
if (!tests.length) {
server.close();