mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -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>
145 lines
3.6 KiB
JavaScript
145 lines
3.6 KiB
JavaScript
// This tests debugger probe JSON output for stable special-cased values.
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const { spawnSyncAndAssert } = require('../common/child_process');
|
|
const {
|
|
assertProbeJson,
|
|
probeTypesScript,
|
|
} = require('../common/debugger-probe');
|
|
|
|
const location = `${probeTypesScript}:17`;
|
|
|
|
spawnSyncAndAssert(process.execPath, [
|
|
'inspect',
|
|
'--json',
|
|
'--probe', location,
|
|
'--expr', 'stringValue',
|
|
'--probe', location,
|
|
'--expr', 'booleanValue',
|
|
'--probe', location,
|
|
'--expr', 'undefinedValue',
|
|
'--probe', location,
|
|
'--expr', 'nullValue',
|
|
'--probe', location,
|
|
'--expr', 'nanValue',
|
|
'--probe', location,
|
|
'--expr', 'bigintValue',
|
|
'--probe', location,
|
|
'--expr', 'symbolValue',
|
|
'--probe', location,
|
|
'--expr', 'functionValue',
|
|
'--probe', location,
|
|
'--expr', 'objectValue',
|
|
'--probe', location,
|
|
'--expr', 'arrayValue',
|
|
'--probe', location,
|
|
'--expr', 'errorValue',
|
|
probeTypesScript,
|
|
], {
|
|
stdout(output) {
|
|
assertProbeJson(output, {
|
|
v: 1,
|
|
probes: [
|
|
{ expr: 'stringValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'booleanValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'undefinedValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'nullValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'nanValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'bigintValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'symbolValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'functionValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'objectValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'arrayValue', target: [probeTypesScript, 17] },
|
|
{ expr: 'errorValue', target: [probeTypesScript, 17] },
|
|
],
|
|
results: [
|
|
{
|
|
probe: 0,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'string', value: 'hello' },
|
|
},
|
|
{
|
|
probe: 1,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'boolean', value: true },
|
|
},
|
|
{
|
|
probe: 2,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'undefined' },
|
|
},
|
|
{
|
|
probe: 3,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'object', subtype: 'null', value: null },
|
|
},
|
|
{
|
|
probe: 4,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'number', unserializableValue: 'NaN', description: 'NaN' },
|
|
},
|
|
{
|
|
probe: 5,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'bigint', unserializableValue: '1n', description: '1n' },
|
|
},
|
|
{
|
|
probe: 6,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: { type: 'symbol', description: 'Symbol(tag)' },
|
|
},
|
|
{
|
|
probe: 7,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: {
|
|
type: 'function',
|
|
description: '() => 1',
|
|
},
|
|
},
|
|
{
|
|
probe: 8,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: {
|
|
type: 'object',
|
|
description: 'Object',
|
|
},
|
|
},
|
|
{
|
|
probe: 9,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: {
|
|
type: 'object',
|
|
subtype: 'array',
|
|
description: 'Array(3)',
|
|
},
|
|
},
|
|
{
|
|
probe: 10,
|
|
event: 'hit',
|
|
hit: 1,
|
|
result: {
|
|
type: 'object',
|
|
subtype: 'error',
|
|
description: 'Error: boom',
|
|
},
|
|
},
|
|
{ event: 'completed' },
|
|
],
|
|
});
|
|
},
|
|
trim: true,
|
|
});
|