From f90490d4758c6c69cc47eb91a8ea6840f2c85ea3 Mon Sep 17 00:00:00 2001 From: Trivikram <16024985+trivikr@users.noreply.github.com> Date: Sat, 17 Feb 2018 18:29:22 -0800 Subject: [PATCH] test: http2 client operations after destroy PR-URL: https://github.com/nodejs/node/pull/18845 Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- test/parallel/test-http2-client-destroy.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-http2-client-destroy.js b/test/parallel/test-http2-client-destroy.js index fab8a4fc24d652..eab413e2327d8f 100644 --- a/test/parallel/test-http2-client-destroy.js +++ b/test/parallel/test-http2-client-destroy.js @@ -59,7 +59,6 @@ const Countdown = require('../common/countdown'); assert(socket.destroyed); })); - const req = client.request(); req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_CANCEL', @@ -77,15 +76,21 @@ const Countdown = require('../common/countdown'); message: 'The session has been destroyed' }; - common.expectsError(() => client.request(), sessionError); + common.expectsError(() => client.setNextStreamID(), sessionError); + common.expectsError(() => client.ping(), sessionError); common.expectsError(() => client.settings({}), sessionError); + common.expectsError(() => client.goaway(), sessionError); + common.expectsError(() => client.request(), sessionError); client.close(); // should be a non-op at this point // Wait for setImmediate call from destroy() to complete // so that state.destroyed is set to true setImmediate(() => { - common.expectsError(() => client.request(), sessionError); + common.expectsError(() => client.setNextStreamID(), sessionError); + common.expectsError(() => client.ping(), sessionError); common.expectsError(() => client.settings({}), sessionError); + common.expectsError(() => client.goaway(), sessionError); + common.expectsError(() => client.request(), sessionError); client.close(); // should be a non-op at this point });