Skip to content
Permalink
Browse files

test: log errors in test-http2-propagate-session-destroy-code

PR-URL: #31072
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
lundibundi authored and BridgeAR committed Dec 23, 2019
1 parent 2c6f817 commit 990760e57fc6a3a2f651c49378228b24bf7f4734
Showing with 4 additions and 4 deletions.
  1. +4 −4 test/parallel/test-http2-propagate-session-destroy-code.js
@@ -15,16 +15,16 @@ server.on('error', common.mustNotCall());
server.on('session', (session) => {
session.on('close', common.mustCall());
session.on('error', common.mustCall((err) => {
assert(errRegEx.test(err));
assert.ok(errRegEx.test(err), `server session err: ${err}`);
assert.strictEqual(session.closed, false);
assert.strictEqual(session.destroyed, true);
}));

session.on('stream', common.mustCall((stream) => {
stream.on('error', common.mustCall((err) => {
assert.ok(errRegEx.test(err), `server stream err: ${err}`);
assert.strictEqual(session.closed, false);
assert.strictEqual(session.destroyed, true);
assert(errRegEx.test(err));
assert.strictEqual(stream.rstCode, destroyCode);
}));

@@ -36,15 +36,15 @@ server.listen(0, common.mustCall(() => {
const session = http2.connect(`http://localhost:${server.address().port}`);

session.on('error', common.mustCall((err) => {
assert(errRegEx.test(err));
assert.ok(errRegEx.test(err), `client session err: ${err}`);
assert.strictEqual(session.closed, false);
assert.strictEqual(session.destroyed, true);
}));

const stream = session.request({ [http2.constants.HTTP2_HEADER_PATH]: '/' });

stream.on('error', common.mustCall((err) => {
assert(errRegEx.test(err));
assert.ok(errRegEx.test(err), `client stream err: ${err}`);
assert.strictEqual(stream.rstCode, destroyCode);
}));

0 comments on commit 990760e

Please sign in to comment.
You can’t perform that action at this time.