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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • 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.