Fixed cluster inspect port logic
This is first PR mentioned in https://github.com/nodejs/node/pull/9659#issuecomment-307211154
Turned out, instead of parsing execArgv and deciding what port to use, we could just add
--inspect-port
to whatever port we calculated (thanks, @sam-github).
I've exported initial debug options to process._debugOptions
, but I need it only in tests for now.
To test new cases (different host:port variations), I wrote new test
suite inspector/test-inspector-port-cluster.js
and deleted
parallel/test-cluster-inspector-debug-port.js
in favor of
it. cluster.setupMaster
wasn't sufficient, I had actually start master process with debug arguments.
(parallel/test-cluster-inspector-debug-port.js
was still passing at the moment)
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
- cluster