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>
35 lines
850 B
JavaScript
35 lines
850 B
JavaScript
// This tests probe session timeout behavior and teardown.
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const { spawnSyncAndExit } = require('../common/child_process');
|
|
const { assertProbeJson, timeoutScript } = require('../common/debugger-probe');
|
|
|
|
spawnSyncAndExit(process.execPath, [
|
|
'inspect',
|
|
'--json',
|
|
'--timeout=200',
|
|
'--probe', `${timeoutScript}:99`,
|
|
'--expr', '1',
|
|
timeoutScript,
|
|
], {
|
|
signal: null,
|
|
status: 1,
|
|
stdout(output) {
|
|
assertProbeJson(output, {
|
|
v: 1,
|
|
probes: [{ expr: '1', target: [timeoutScript, 99] }],
|
|
results: [{
|
|
event: 'timeout',
|
|
pending: [0],
|
|
error: {
|
|
code: 'probe_timeout',
|
|
message: `Timed out after 200ms waiting for probes: ${timeoutScript}:99`,
|
|
},
|
|
}],
|
|
});
|
|
},
|
|
trim: true,
|
|
});
|