node/test/parallel/test-debugger-probe-timeout.js
Joyee Cheung f30139e3b9
debugger: add more logs to probe mode
Add more log points in the probe mode and enable the debuglog
int the probe mode tests.

Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/63663
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
2026-06-01 20:36:47 +00:00

41 lines
1.1 KiB
JavaScript

// This tests probe session timeout behavior and teardown.
'use strict';
const common = require('../common');
common.skipIfInspectorDisabled();
const fixtures = require('../common/fixtures');
const { spawnSyncAndExit } = require('../common/child_process');
const { assertProbeJson } = require('../common/debugger-probe');
const cwd = fixtures.path('debugger');
const timeout = common.platformTimeout(1000);
spawnSyncAndExit(process.execPath, [
'inspect',
'--json',
`--timeout=${timeout}`,
'--probe', 'probe-timeout.js:99',
'--expr', '1',
'probe-timeout.js',
], { cwd, env: { ...process.env, NODE_DEBUG: 'inspect_probe' } }, {
signal: null,
status: 1,
stdout(output) {
assertProbeJson(output, {
v: 2,
probes: [{
expr: '1',
target: { suffix: 'probe-timeout.js', line: 99 },
}],
results: [{
event: 'timeout',
pending: [0],
error: {
code: 'probe_timeout',
message: `Timed out after ${timeout}ms waiting for probes: probe-timeout.js:99`,
},
}],
});
},
trim: true,
});