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 <mdawson@devrus.com>

PR-URL: #37447
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
  • Loading branch information
mhdawson authored and targos committed May 1, 2021
1 parent 099eef6 commit d168cde
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions test/parallel/test-http2-clean-output.js
@@ -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 d168cde

Please sign in to comment.