Skip to content

Commit 069fd79

Browse files
TrottBethGriggs
authored andcommitted
test: improve debugging information for http2 test
In test-http2-session-timeout, provide the number of requests that occurred when the test fails. Backport-PR-URL: #22850 PR-URL: #23058 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent c0f8e49 commit 069fd79

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/sequential/test-http2-session-timeout.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33
const common = require('../common');
44
if (!common.hasCrypto)
55
common.skip('missing crypto');
6+
const assert = require('assert');
67
const http2 = require('http2');
78

89
const serverTimeout = common.platformTimeout(200);
9-
const mustNotCall = common.mustNotCall();
1010

11+
let requests = 0;
12+
const mustNotCall = () => {
13+
assert.fail(`Timeout after ${requests} request(s)`);
14+
};
1115
const server = http2.createServer();
1216
server.timeout = serverTimeout;
1317

@@ -32,6 +36,8 @@ server.listen(0, common.mustCall(() => {
3236
request.resume();
3337
request.end();
3438

39+
requests += 1;
40+
3541
request.on('end', () => {
3642
const diff = process.hrtime(startTime);
3743
const milliseconds = (diff[0] * 1e3 + diff[1] / 1e6);

0 commit comments

Comments
 (0)