-
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,test: fix flaky debug logging on SmartOS #3615
Conversation
// SmartOS sometimes munges output from `process._rawDebug()` | ||
// but Windows can't use `console.error()`. | ||
// https://github.com/nodejs/node/issues/2476 | ||
if (process.platform == 'win32') { |
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.
===
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 usually feel like I need a bath after typing ==
instead of ===
. Not sure how that happened. Will change for sure.
Addressed @cjihrig suggestions, pushed a fixup commit, killed the prior CI and re-running. New CI at: https://ci.nodejs.org/job/node-test-pull-request/654/ UPDATE: CI looks good. One |
// SmartOS sometimes munges output from `process._rawDebug()` | ||
// but Windows can't use `console.error()`. | ||
// https://github.com/nodejs/node/issues/2476 | ||
const log = process.platform === 'win32' ? process._rawDebug : console.error; |
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.
You can use common.isWindows
Edit: Nvm. This is not 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.
is _rawDebug
out of scope to fix?
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.
@jbergstroem I suppose not, although I'm not even sure this is a bug in _rawDebug
and not an OS bug. I don't have a SmartOS machine to mess around with.
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.
happy to give you access if you want to tinker around.
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.
Cool, I may be in touch. (Going to focus on getting to sleep now.) BTW, it could also go the other way, I imagine, and be a "fix console.error()
in this context for Windows" . If that happened, there would be no reason for _rawDebug()
to exist. Of course, that might be an impossibility for all I know...
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.
@jbergstroem My public keys are at https://github.com/trott.keys. What else would you need to give me access?
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.
@Trott ping me at bugs at bergstroem.nu
or jbergstroem@irc.
Sounds like a |
Just to be clear then; what actually needs fixing is |
Guess it's time for me to brush up a bit on my so-rusty-as-to-be-nonexistent C++ skillz.... |
SmartOS sometimes munges output from `process._rawDebug()` but Windows can't use `console.error()` in the debug agent. So inject logic to chose the right thing based on platform. Fixes: nodejs#2476
If I change line 3066 of
...to...
...and trigger the bug, the output looks like this:
The one thing this proves is that But how the heck are the lines getting interwoven like that?!
For fun, I tried adding My somewhat ignorant guesses are:
Does someone more knowledgable than me see something obvious I'm missing? I'm happy to keep pushing on this but it feels like something someone with more experience on the C++ side might see right away. |
Replacing SmartOS bug/feature? |
It looks like ultimately the problem is that |
Closing in favor of #3701 |
SmartOS does not line buffer stderr by default, or at least that is the behavior on the Node project Jenkins server. Force line buffering. This resolves the flakiness observed on SmartOS for test-debug-signal-cluster. Fixes: nodejs#2476 Refs: nodejs#3615
SmartOS does not line buffer stderr by default, or at least that is the behavior on the Node project Jenkins server. Force line buffering. This resolves the flakiness observed on SmartOS for test-debug-signal-cluster. PR-URL: nodejs#3701 Fixes: nodejs#2476 Refs: nodejs#3615 Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
SmartOS does not line buffer stderr by default, or at least that is the behavior on the Node project Jenkins server. Force line buffering. This resolves the flakiness observed on SmartOS for test-debug-signal-cluster. PR-URL: #3701 Fixes: #2476 Refs: #3615 Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
removing lts-watch tag as this did not land |
SmartOS does not line buffer stderr by default, or at least that is the behavior on the Node project Jenkins server. Force line buffering. This resolves the flakiness observed on SmartOS for test-debug-signal-cluster. PR-URL: #3701 Fixes: #2476 Refs: #3615 Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
SmartOS does not line buffer stderr by default, or at least that is the behavior on the Node project Jenkins server. Force line buffering. This resolves the flakiness observed on SmartOS for test-debug-signal-cluster. PR-URL: #3701 Fixes: #2476 Refs: #3615 Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
SmartOS does not line buffer stderr by default, or at least that is the behavior on the Node project Jenkins server. Force line buffering. This resolves the flakiness observed on SmartOS for test-debug-signal-cluster. PR-URL: #3701 Fixes: #2476 Refs: #3615 Reviewed-By: Johan Bergström <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
SmartOS sometimes munges output from
process._rawDebug()
but Windows can't use
console.error()
in the debug agent.So inject logic to chose the right thing based on platform.
Fixes: #2476