Skip to content
Closed
Prev Previous commit
Next Next commit
test: fix test-inspector-cli-address
The test was assuming that the entire string being sought would arrive
in a single data chunk, but it can be split across multiple chunks.

PR-URL: #38161
Backport-PR-URL: #38858
Refs: https://github.com/nodejs/node/discussions/36481
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
Trott committed Jul 15, 2021
commit e5ee810827641f8f3b7ed425a45c3e41aac5b482
4 changes: 3 additions & 1 deletion deps/node-inspect/test/cli/address.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ function launchTarget(...args) {
};
childProc.on('exit', onExit);
childProc.stderr.setEncoding('utf8');
childProc.stderr.on('data', (data) => {
let data = '';
childProc.stderr.on('data', (chunk) => {
data += chunk;
const ret = kDebuggerMsgReg.exec(data);
childProc.removeListener('exit', onExit);
if (ret) {
Expand Down