Skip to content

Commit

Permalink
test: add http2/tls destroy regression test
Browse files Browse the repository at this point in the history
Test part of 0c25cdf,
specifically for v8.x.

PR-URL: #21598
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
addaleax authored and MylesBorins committed Jul 13, 2018
1 parent 2afc05e commit 02e4555
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/parallel/test-http2-tls-disconnect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
'use strict';
const common = require('../common');
const fixtures = require('../common/fixtures');

if (!common.hasCrypto)
common.skip('missing crypto');

const child_process = require('child_process');
const http2 = require('http2');
const fs = require('fs');

const key = fixtures.readKey('agent8-key.pem', 'binary');
const cert = fixtures.readKey('agent8-cert.pem', 'binary');

const server = http2.createSecureServer({ key, cert }, (request, response) => {
fs.createReadStream(process.execPath).pipe(response);
});

// This should be doable with a reproduction purely written in Node;
// that just requires somebody to take the time and actually do it.
server.listen(0, () => {
const proc = child_process.spawn('h2load', [
'-n', '1000',
`https://localhost:${server.address().port}/`
]);
proc.on('error', (err) => {
if (err.code === 'ENOENT')
common.skip('no h2load');
});
proc.on('exit', () => server.close());
setTimeout(() => proc.kill(2), 100);
});

0 comments on commit 02e4555

Please sign in to comment.