mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
This works around a pre-existing inspector issue: if the debuggee exits too quickly the inspector can segfault while tearing down. For now normalize the trailing segfault as completion to keep the CI green until the upstream bug is fixed, since it only reproduces on some slow CI machines and is not what the probe tests care about. PR-URL: https://github.com/nodejs/node/pull/62851 Refs: https://github.com/nodejs/node/issues/62765 Refs: https://github.com/nodejs/node/issues/58245 Reviewed-By: Jan Martin <jan.krems@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
66 lines
1.6 KiB
JavaScript
66 lines
1.6 KiB
JavaScript
// This tests debugger probe JSON output for duplicate and multi-probe hits.
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const { spawnSyncAndAssert } = require('../common/child_process');
|
|
const { assertProbeJson, probeScript } = require('../common/debugger-probe');
|
|
|
|
spawnSyncAndAssert(process.execPath, [
|
|
'inspect',
|
|
'--json',
|
|
'--probe', `${probeScript}:8`,
|
|
'--expr', 'index',
|
|
'--probe', `${probeScript}:8`,
|
|
'--expr', 'total',
|
|
'--probe', `${probeScript}:12`,
|
|
'--expr', 'finalValue',
|
|
probeScript,
|
|
], {
|
|
stdout(output) {
|
|
assertProbeJson(output, {
|
|
v: 1,
|
|
probes: [
|
|
{ expr: 'index', target: [probeScript, 8] },
|
|
{ expr: 'total', target: [probeScript, 8] },
|
|
{ expr: 'finalValue', target: [probeScript, 12] },
|
|
],
|
|
results: [
|
|
{
|
|
probe: 0,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'number', value: 0, description: '0' },
|
|
},
|
|
{
|
|
probe: 1,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'number', value: 0, description: '0' },
|
|
},
|
|
{
|
|
probe: 0,
|
|
event: 'hit',
|
|
hit: 2,
|
|
result: { type: 'number', value: 1, description: '1' },
|
|
},
|
|
{
|
|
probe: 1,
|
|
event: 'hit',
|
|
hit: 2,
|
|
result: { type: 'number', value: 40, description: '40' },
|
|
},
|
|
{
|
|
probe: 2,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'number', value: 81, description: '81' },
|
|
},
|
|
{ event: 'completed' },
|
|
],
|
|
});
|
|
},
|
|
trim: true,
|
|
});
|