mirror of
https://github.com/nodejs/node.git
synced 2025-05-10 03:12:57 +00:00

Remove `--debug-http2` as a compile-time feature and make all debug statements available using `NODE_DEBUG_NATIVE=http2` at runtime. This probably makes the debugging-enabled case a bit slower due to additional string concatenations, but switching to a runtime-checking system makes debugging more flexible and can be applied more easily to other parts of the source code as well. PR-URL: https://github.com/nodejs/node/pull/20987 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: James M Snell <jasnell@gmail.com>
19 lines
705 B
JavaScript
19 lines
705 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const child_process = require('child_process');
|
|
const path = require('path');
|
|
|
|
process.env.NODE_DEBUG_NATIVE = 'http2';
|
|
const { stdout, stderr } = child_process.spawnSync(process.execPath, [
|
|
path.resolve(__dirname, 'test-http2-ping.js')
|
|
], { encoding: 'utf8' });
|
|
|
|
assert(stderr.match(/Http2Session client \(\d+\) handling data frame for stream \d+/),
|
|
stderr);
|
|
assert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session client \(\d+\)\] reading starting/),
|
|
stderr);
|
|
assert(stderr.match(/HttpStream \d+ \(\d+\) \[Http2Session server \(\d+\)\] tearing down stream/),
|
|
stderr);
|
|
assert.strictEqual(stdout.trim(), '');
|