-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix and improve debugger-client test #10371
Conversation
a9c33e4
to
e8995ce
Compare
You would probably do @thealphanerd a favor by figuring out how to backport sooner rather than later. I'm thinking specifically about the file that was renamed twice. (Is it one of the old names in v4 or v6? If so, then this won't work and we'll need a different PR for those) |
@@ -158,7 +158,7 @@ function doTest(cb, done) { | |||
console.error('got stderr data %j', data); | |||
nodeProcess.stderr.resume(); | |||
b += data; | |||
if (didTryConnect === false && b.match(/Debugger listening on port/)) { | |||
if (didTryConnect === false && b.match(/Debugger listening on/)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Maybe leave a space at the end of the regexp? /Debugger listening on /
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.
@@ -168,7 +168,7 @@ function doTest(cb, done) { | |||
|
|||
function tryConnect() { | |||
// Wait for some data before trying to connect | |||
var c = new debug.Client(); | |||
const c = new debug.Client(); | |||
console.error('>>> connecting...'); | |||
c.connect(debug.port); | |||
c.on('break', function(brk) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: While you're in here, maybe remove brk
as a callback argument. It is unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Left a couple of nits. Also, two other callback arguments appear to be unused, if you want to clean those up too: res
on line 19 and c
on line 140.
This test expects the string 'Debugger listening on port' on stderr and since the message has been changed to 'Debugger listening on host:port' this was failing always. Apart from that, this test expects the main script's name to be `src/node.js`, but that has been renamed to `lib/internal/node.js` and then to `lib/internal/bootstrap_node.js`. So, the script name has been updated. Apart from that, using `const` instead of `var` wherever possible. Refer: nodejs#10361
e8995ce
to
2df054b
Compare
Thanks @Trott. Addressed all the nits. |
This test expects the string 'Debugger listening on port' on stderr and since the message has been changed to 'Debugger listening on host:port' this was failing always. Apart from that, this test expects the main script's name to be `src/node.js`, but that has been renamed to `lib/internal/node.js` and then to `lib/internal/bootstrap_node.js`. So, the script name has been updated. Apart from that, using `const` instead of `var` wherever possible. Refer: nodejs#10361 PR-URL: nodejs#10371 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 3ef4ec0 |
This test expects the string 'Debugger listening on port' on stderr and since the message has been changed to 'Debugger listening on host:port' this was failing always. Apart from that, this test expects the main script's name to be `src/node.js`, but that has been renamed to `lib/internal/node.js` and then to `lib/internal/bootstrap_node.js`. So, the script name has been updated. Apart from that, using `const` instead of `var` wherever possible. Refer: #10361 PR-URL: #10371 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This test expects the string 'Debugger listening on port' on stderr and since the message has been changed to 'Debugger listening on host:port' this was failing always. Apart from that, this test expects the main script's name to be `src/node.js`, but that has been renamed to `lib/internal/node.js` and then to `lib/internal/bootstrap_node.js`. So, the script name has been updated. Apart from that, using `const` instead of `var` wherever possible. Refer: #10361 PR-URL: #10371 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This does not land cleanly in LTS. Added dont-land label. Please feel free to manually backport |
This test expects the string 'Debugger listening on port' on stderr and since the message has been changed to 'Debugger listening on host:port' this was failing always. Apart from that, this test expects the main script's name to be `src/node.js`, but that has been renamed to `lib/internal/node.js` and then to `lib/internal/bootstrap_node.js`. So, the script name has been updated. Apart from that, using `const` instead of `var` wherever possible. Refer: nodejs#10361 PR-URL: nodejs#10371 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This test expects the string 'Debugger listening on port' on stderr and since the message has been changed to 'Debugger listening on host:port' this was failing always. Apart from that, this test expects the main script's name to be `src/node.js`, but that has been renamed to `lib/internal/node.js` and then to `lib/internal/bootstrap_node.js`. So, the script name has been updated. Apart from that, using `const` instead of `var` wherever possible. Refer: #10361 PR-URL: #10371 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This test expects the string 'Debugger listening on port' on stderr and since the message has been changed to 'Debugger listening on host:port' this was failing always. Apart from that, this test expects the main script's name to be `src/node.js`, but that has been renamed to `lib/internal/node.js` and then to `lib/internal/bootstrap_node.js`. So, the script name has been updated. Apart from that, using `const` instead of `var` wherever possible. Refer: #10361 PR-URL: #10371 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
Affected core subsystem(s)
test debugger
Description of change
This test expects the string 'Debugger listening on port' on stderr and
since the message has been changed to 'Debugger listening on host:port'
this was failing always.
Apart from that, this test expects the main script's name to be
src/node.js
, but that has been renamed tolib/internal/node.js
andthen to
lib/internal/bootstrap_node.js
. So, the script name has beenupdated.
Apart from that, using
const
instead ofvar
wherever possible.Refer: #10361