-
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
inspector: check if connected before waiting #10094
Conversation
|
||
let child = null; | ||
|
||
function DidNotShutdown() { |
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.
Can you make this didNotShutdown()
please.
common.fail('Did not shut down'); | ||
} | ||
|
||
const timeout = setTimeout(DidNotShutdown, 60 * 1000); |
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.
This seems like a long timeout for a test.
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 doubt it will ever trigger during a normal run because the test runner is going to kill the test after 5 or 10 seconds. It's probably easiest to simply scrap this code.
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.
A few nits on the test, but LGTM.
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 with a suggestion. Please fix the style issue if you want to keep the timeout.
common.fail('Did not shut down'); | ||
} | ||
|
||
const timeout = setTimeout(DidNotShutdown, 60 * 1000); |
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 doubt it will ever trigger during a normal run because the test runner is going to kill the test after 5 or 10 seconds. It's probably easiest to simply scrap this code.
Thank you for the reviews, I've updated the test case. |
|
||
process.on('exit', exitHandler); | ||
process.on('SIGINT', exitHandler); | ||
process.on('SIGTERM', exitHandler); |
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.
Installing listeners for SIGINT and SIGTERM will override the default behavior of terminating when the signal is received. Call process.exit()
in the callback.
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.
Thanks. It is now using exit code 1 to indicate error. I also removed the 'exit' handler.
|
||
const child = spawn(process.execPath, | ||
[ '--inspect', 'no-such-script.js' ], | ||
{ 'stdio': 'inherit' }); |
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.
Can you make the arguments line up?
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.
Seems like https://ci.nodejs.org/job/node-test-pull-request/5269/ is all green but results are not reported back to GitHub for some reason. |
Landed as 2f3865d |
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
inspector: a check was added
Description of change
This change adds a check to see if there's a frontend connection before waiting for a disconnect.
Fixes: #10093