-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
debugger: call this.resume()
after this.run()
#10099
Conversation
This addresses #9854
The debugger, or at least this implementation of it, is going away after version 7 of Node.js and it's been a challenge to write robust debugger tests. So I'd be OK with making an exception to the usual "bug-fixes should have tests" rule on this one. Although it might be worth checking if this fixes some of the broken tests in Sorry for introducing the bug and thanks for fixing my mistake! |
LGTM if CI is ✅ |
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.
Makes sense given the commit that introduced the regression. LGTM as far as I can tell.
Hmm CI is not happy. But I can't work out what the issue is with linting. Locally I've run |
Let's try a new CI: https://ci.nodejs.org/job/node-test-pull-request/5150/ |
@@ -829,7 +829,7 @@ function Interface(stdin, stdout, args) { | |||
// Run script automatically | |||
this.pause(); | |||
|
|||
setImmediate(() => { this.run(); }); | |||
setImmediate(() => { this.run( () => this.resume() ); }); |
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.
Extra spaces between (
and ()
, and ()
and )
.
Do we have a test for this? |
@indutny no test yet. Existing tests did not catch the regression, but I haven't worked out a new test. I don't think I'll be able to get to it today, but I can devise something in the next couple of days if necessary. Edit Test added |
And yet a 3rd CI https://ci.nodejs.org/job/node-test-pull-request/5151/ |
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. Seemingly unrelated flake on the freebsd10-64 buildbot.
const common = require('../common'); | ||
const spawn = require('child_process').spawn; | ||
|
||
const timeoutId = setTimeout(function() { |
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.
Is the timeout needed? Couldn't we just let the test timeout and fail instead of introducing a timer?
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.
I suppose it is redundant. I was just modeling off of another test that spawns a node process.
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.
Yea, if you don't need it, I'd remove it. They add complexity to the code and timers have been a source of annoyance on the CI.
Landed in 6410534 |
This should have had another CI run before landing I think. |
@cjihrig sorry about that - I did run another CI but didn't link it. Looks like unrelated flakiness on Windows. https://ci.nodejs.org/job/node-test-pull-request/5210/ |
I've added the |
When the debugger has started we need to call `this.resume` otherwise, the prompt won't appear. Fixes: nodejs#9854 PR-URL: nodejs#10099 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Rich Trott <rtrott@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
debugger
Description of change
This addresses #9854
The issue was introduced here and first appeared in 6.2.2.
I haven't figured out the best way to test this yet. Apparently, existing tests didn't catch the regression though.