Skip to content

Commit

Permalink
test: log errors in test-http2-propagate-session-destroy-code
Browse files Browse the repository at this point in the history
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 Jan 3, 2020
1 parent 2c6f817 commit 990760e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-http2-propagate-session-destroy-code.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}));

Expand All @@ -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);
}));

Expand Down

0 comments on commit 990760e

Please sign in to comment.