Skip to content

Commit dfa0440

Browse files
mhdawsontargos
authored andcommittedFeb 28, 2021
test: validate no debug info for http2
Refs: #31763 This test would have helped us catch the noisy output from http2 earlier. Currently none of the tests fail if there is unexpected debug output. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #37447 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com>
1 parent 834f637 commit dfa0440

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
 
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
'use strict';
2+
3+
const {
4+
hasCrypto,
5+
mustCall,
6+
skip
7+
} = require('../common');
8+
if (!hasCrypto)
9+
skip('missing crypto');
10+
11+
const {
12+
strictEqual
13+
} = require('assert');
14+
const {
15+
createServer,
16+
connect
17+
} = require('http2');
18+
const {
19+
spawnSync
20+
} = require('child_process');
21+
22+
// Validate that there is no unexpected output when
23+
// using http2
24+
if (process.argv[2] !== 'child') {
25+
const {
26+
stdout, stderr, status
27+
} = spawnSync(process.execPath, [__filename, 'child'], { encoding: 'utf8' });
28+
strictEqual(stderr, '');
29+
strictEqual(stdout, '');
30+
strictEqual(status, 0);
31+
} else {
32+
const server = createServer();
33+
server.listen(0, mustCall(() => {
34+
const client = connect(`http://localhost:${server.address().port}`);
35+
client.on('connect', mustCall(() => {
36+
client.close();
37+
server.close();
38+
}));
39+
}));
40+
}

0 commit comments

Comments
 (0)