-
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
trace_events: stop tracing agent in process.exit() #18005
trace_events: stop tracing agent in process.exit() #18005
Conversation
|
||
proc.once('exit', common.mustCall(() => { | ||
assert(common.fileExists(FILE_NAME)); | ||
fs.readFile(FILE_NAME, common.mustCall((err, data) => { |
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.
Use fs.readFileSync
here, the async version is not guaranteed to complete. In fact, it probably doesn't but that goes unnoticed because the common.mustCall(...)
isn't checked as you're already inside an exit handler.
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 is a child process 'exit'
event, not process.exit()
. fs.readFileSync()
is probably a simpler idea either way though.
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 is how all of the other trace-events
tests work. I can change it, but at least it should be consistent.
Landed in 6aac05b |
PR-URL: #18005 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: #18005 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
PR-URL: nodejs#18005 Backport-PR-URL: nodejs#18179 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
trace_events