diff options
author | Michael Dawson <mdawson@devrus.com> | 2021-02-19 22:55:35 +0300 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2021-02-28 16:40:16 +0300 |
commit | dfa0440341f04747af28fea74f812da7996febf3 (patch) | |
tree | 80cf51fd330791ce5a9b1ada88ef879d0e71a36d /test | |
parent | 834f63793aadf7cf63e269afed94bd9fa91d56be (diff) |
test: validate no debug info for http2
Refs: https://github.com/nodejs/node/issues/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: https://github.com/nodejs/node/pull/37447
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-http2-clean-output.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/parallel/test-http2-clean-output.js b/test/parallel/test-http2-clean-output.js new file mode 100644 index 00000000000..27b7c338c9a --- /dev/null +++ b/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(); + })); + })); +} |