Closed
Conversation
To indicate which lines are test lines and which from Node.js core, it's good to rely on `util.inspect()` while inspecting errors. The stack was accessed directly instead in multiple cases and logging that does not provide as much information as using `util.inspect()`.
Collaborator
Member
Author
|
@nodejs/testing @nodejs/util PTAL. This improves the terminal output for multiple error cases in our tests. |
Member
|
LGTM. Might be a good idea to post something in a comment here showing the before/after difference. Might be useful for both current reviewers and people doing git-archaeology at a later date. |
Trott
approved these changes
Jan 23, 2020
Trott
reviewed
Jan 23, 2020
Collaborator
Collaborator
Trott
reviewed
Jan 26, 2020
| throw new Error(`same id added to destroy list twice (${id})`); | ||
| } | ||
| destroyListList[id] = new Error().stack; | ||
| destroyListList[id] = util.inspect(new Error()); |
Member
There was a problem hiding this comment.
What's an example of a situation where this will result in a better stack?
Member
Author
There was a problem hiding this comment.
Node.js core frames are visualized in grey. It makes it easier to distinguish the test code from core code.
jasnell
approved these changes
Feb 5, 2020
yhwang
approved these changes
Feb 5, 2020
BridgeAR
added a commit
that referenced
this pull request
Feb 9, 2020
To indicate which lines are test lines and which from Node.js core, it's good to rely on `util.inspect()` while inspecting errors. The stack was accessed directly instead in multiple cases and logging that does not provide as much information as using `util.inspect()`. PR-URL: #31425 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yihong Wang <yh.wang@ibm.com>
Member
Author
|
Landed in 1450ea7 🎉 |
codebytere
pushed a commit
that referenced
this pull request
Feb 17, 2020
To indicate which lines are test lines and which from Node.js core, it's good to rely on `util.inspect()` while inspecting errors. The stack was accessed directly instead in multiple cases and logging that does not provide as much information as using `util.inspect()`. PR-URL: #31425 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yihong Wang <yh.wang@ibm.com>
Merged
Member
|
@BridgeAR if this is something that should be in |
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 25, 2020
To indicate which lines are test lines and which from Node.js core, it's good to rely on `util.inspect()` while inspecting errors. The stack was accessed directly instead in multiple cases and logging that does not provide as much information as using `util.inspect()`. PR-URL: nodejs#31425 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yihong Wang <yh.wang@ibm.com>
targos
pushed a commit
that referenced
this pull request
Apr 28, 2020
To indicate which lines are test lines and which from Node.js core, it's good to rely on `util.inspect()` while inspecting errors. The stack was accessed directly instead in multiple cases and logging that does not provide as much information as using `util.inspect()`. PR-URL: #31425 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yihong Wang <yh.wang@ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To indicate which lines are test lines and which are from Node.js core,
it's good to rely upon
util.inspect()while inspecting errors. Using it also logs error properties and provides more informations about the error.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes