mirror of
https://github.com/nodejs/node.git
synced 2024-11-28 22:46:31 +01:00
10ccf56f89
When configured --without-ssl the inspect-brk option will not be available and the process will exit with a exit value of 9 "Invalid Argument/Bad option". This commit adds a skipIfInspectorDisabled check since --without-ssl implies that no inspector support is build as well. PR-URL: https://github.com/nodejs/node/pull/12757 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
38 lines
990 B
JavaScript
38 lines
990 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
// A test to ensure that cluster properly interoperates with the
|
|
// --inspect-brk option.
|
|
|
|
const assert = require('assert');
|
|
const cluster = require('cluster');
|
|
const debuggerPort = common.PORT;
|
|
|
|
if (cluster.isMaster) {
|
|
function test(execArgv) {
|
|
|
|
cluster.setupMaster({
|
|
execArgv: execArgv,
|
|
stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe']
|
|
});
|
|
|
|
const worker = cluster.fork();
|
|
|
|
// Debugger listening on port [port].
|
|
worker.process.stderr.once('data', common.mustCall(function() {
|
|
worker.process.kill('SIGTERM');
|
|
}));
|
|
|
|
worker.process.on('exit', common.mustCall(function(code, signal) {
|
|
assert.strictEqual(signal, 'SIGTERM');
|
|
}));
|
|
}
|
|
|
|
test(['--inspect-brk']);
|
|
test([`--inspect-brk=${debuggerPort}`]);
|
|
} else {
|
|
// Cluster worker is at a breakpoint, should not reach here.
|
|
assert.fail('Test failed: cluster worker should be at a breakpoint.');
|
|
}
|