Skip to content

Commit 48c1c42

Browse files
Trotttargos
authored andcommittedOct 3, 2018
test: improve debugging information for http2 test
In test-http2-session-timeout, provide the number of requests that occurred when the test fails. 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 f486186 commit 48c1c42

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +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();
10+
11+
let requests = 0;
12+
const mustNotCall = () => {
13+
assert.fail(`Timeout after ${requests} request(s)`);
14+
};
1015

1116
const server = http2.createServer();
1217
server.timeout = serverTimeout;
@@ -32,6 +37,8 @@ server.listen(0, common.mustCall(() => {
3237
request.resume();
3338
request.end();
3439

40+
requests += 1;
41+
3542
request.on('end', () => {
3643
const diff = process.hrtime(startTime);
3744
const milliseconds = (diff[0] * 1e3 + diff[1] / 1e6);

0 commit comments

Comments
 (0)
Please sign in to comment.