Skip to content

Commit

Permalink
test: validate no debug info for http2
Browse files Browse the repository at this point in the history
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 <[email protected]>

PR-URL: #37447
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
  • Loading branch information
mhdawson committed Feb 23, 2021
1 parent aecae19 commit 4eec919
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/parallel/test-http2-clean-output.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
'use strict';

const {
hasCrypto,
mustCall,
skip
} = require('../common');
if (!hasCrypto)
skip('missing crypto');

const {
strictEqual
} = require('assert');
const {
createServer,
connect
} = require('http2');
const {
spawnSync
} = require('child_process');

// Validate that there is no unexpected output when
// using http2
if (process.argv[2] !== 'child') {
const {
stdout, stderr, status
} = spawnSync(process.execPath, [__filename, 'child'], { encoding: 'utf8' });
strictEqual(stderr, '');
strictEqual(stdout, '');
strictEqual(status, 0);
} else {
const server = createServer();
server.listen(0, mustCall(() => {
const client = connect(`http://localhost:${server.address().port}`);
client.on('connect', mustCall(() => {
client.close();
server.close();
}));
}));
}

0 comments on commit 4eec919

Please sign in to comment.