Skip to content

Commit 8053474

Browse files
addaleaxrvagg
authored andcommitted
test: add http2/tls destroy regression test
Test part of 0c25cdf, specifically for v8.x. PR-URL: #21598 Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent 8e0f28b commit 8053474

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
'use strict';
2+
const common = require('../common');
3+
const fixtures = require('../common/fixtures');
4+
5+
if (!common.hasCrypto)
6+
common.skip('missing crypto');
7+
8+
const child_process = require('child_process');
9+
const http2 = require('http2');
10+
const fs = require('fs');
11+
12+
const key = fixtures.readKey('agent8-key.pem', 'binary');
13+
const cert = fixtures.readKey('agent8-cert.pem', 'binary');
14+
15+
const server = http2.createSecureServer({ key, cert }, (request, response) => {
16+
fs.createReadStream(process.execPath).pipe(response);
17+
});
18+
19+
// This should be doable with a reproduction purely written in Node;
20+
// that just requires somebody to take the time and actually do it.
21+
server.listen(0, () => {
22+
const proc = child_process.spawn('h2load', [
23+
'-n', '1000',
24+
`https://localhost:${server.address().port}/`
25+
]);
26+
proc.on('error', (err) => {
27+
if (err.code === 'ENOENT')
28+
common.skip('no h2load');
29+
});
30+
proc.on('exit', () => server.close());
31+
setTimeout(() => proc.kill(2), 100);
32+
});

0 commit comments

Comments
 (0)