Skip to content

lib: add 'pid' prefix in internal/util#3878

Closed
JungMinu wants to merge 1 commit into
nodejs:masterfrom
JungMinu:patch-21
Closed

lib: add 'pid' prefix in internal/util#3878
JungMinu wants to merge 1 commit into
nodejs:masterfrom
JungMinu:patch-21

Conversation

@JungMinu

Copy link
Copy Markdown
Member

This PR improves prefix in util that we've agreed on #3833
(separate PR for javascript in lib, and the original PR will be updated to move the printing function to C++ in src directly)

@cjihrig

cjihrig commented Nov 17, 2015

Copy link
Copy Markdown
Contributor

LGTM

@evanlucas

Copy link
Copy Markdown
Contributor

won't this break some tests?

@cjihrig

cjihrig commented Nov 17, 2015

Copy link
Copy Markdown
Contributor

I would imagine for any tests checking for the old string. @JungMinu did you run the tests locally with your changes?

@mscdex mscdex added the util Issues and PRs related to the built-in util module. label Nov 17, 2015
@silverwind

Copy link
Copy Markdown
Contributor

@jasnell

jasnell commented Nov 17, 2015

Copy link
Copy Markdown
Member

LGTM if CI is green

Update: ... which, it's not ... sadly. @JungMinu , can you please take a look at the failing tests and update those here as well. Thank you!

@evanlucas

Copy link
Copy Markdown
Contributor

Yea, test-deprecation-flags.js is failing

@jasnell

jasnell commented Nov 18, 2015

Copy link
Copy Markdown
Member

@JungMinu ... I'll take a look in the morning. Could you post the failure that you're seeing, however?

@martfors

Copy link
Copy Markdown
Contributor

Looking at the test message I'm guessing this is because you haven't updated the test to use your new prefix instead of the hardcoded one when comparing the two warnings.

@JungMinu

Copy link
Copy Markdown
Member Author

@jasnell I found the solution, Thanks :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure that the child process' pid will always be current+1 ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@targos would you recommend alternative to fix this? :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use a RegExp to match stderr

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, something like assert(/util\.debug is deprecated/.test(stderr)) could suffice, but you could also use the RegExp constructor to match the whole line.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@targos @silverwind Yup, I will update soon, Thanks :)

@JungMinu

Copy link
Copy Markdown
Member Author

@jasnell @silverwind @cjihrig Thanks, finished with RegExp:)

@jasnell

jasnell commented Nov 19, 2015

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, just looking at this again. Couldn't you just assert(/util\.debug is deprecated.../.test(stderr));

@JungMinu

Copy link
Copy Markdown
Member Author

@cjihrig Sure, updated :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh. I put ... in my original comment to avoid typing out the entire message. Sorry for the mix up.

Funny, this should actually still work, since . matches a single character. I don't think it's necessary to try to match the entire deprecation message verbatim. Drop the ... and this LGTM. Sorry again.

This PR improves `prefix` in `util` that we've agreed on #3833
(separate code for javascript to move the printing function to C++ directly)

lib: add 'pid' prefix in `internal/util`
@JungMinu

Copy link
Copy Markdown
Member Author

@cjihrig No problem, finished :)

@silverwind

Copy link
Copy Markdown
Contributor

@jasnell

jasnell commented Nov 20, 2015

Copy link
Copy Markdown
Member

Seeing one possibly flaky test error in CI (see https://ci.nodejs.org/job/node-test-commit-linux/1271/nodes=fedora21/console). Assuming that's an unrelated error, LGTM

@targos

targos commented Nov 20, 2015

Copy link
Copy Markdown
Member

LGTM

@cjihrig

cjihrig commented Nov 20, 2015

Copy link
Copy Markdown
Contributor

LGTM (still)

@jasnell

jasnell commented Nov 20, 2015

Copy link
Copy Markdown
Member

will get this landed!

jasnell pushed a commit that referenced this pull request Nov 20, 2015
This PR improves `prefix` in `util` that we've agreed on
#3833
(separate code for javascript to move the printing function
to C++ directly)

PR-URL: #3878
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell

jasnell commented Nov 20, 2015

Copy link
Copy Markdown
Member

Landed in d01eb68

@jasnell jasnell closed this Nov 20, 2015
@jasnell

jasnell commented Nov 20, 2015

Copy link
Copy Markdown
Member

@JungMinu ... I know that #3833 is still pending. Hopefully we can close on that one soon

@JungMinu

Copy link
Copy Markdown
Member Author

@jasnell Yes, I will finish that PR tomorrow :)

@jasnell

jasnell commented Nov 20, 2015

Copy link
Copy Markdown
Member

thank you @JungMinu !

@rvagg rvagg added the semver-major PRs that contain breaking changes and should be released in the next major version. label Dec 5, 2015
@rvagg

rvagg commented Dec 5, 2015

Copy link
Copy Markdown
Member

I believe this should be semver-major like the other changes to error messages. Tagging it as such will ensure it won't slip in to v5.x (like it just did while I was working through the list).

Please speak up if you disagree or if you think I'm reading this wrong.

@jasnell

jasnell commented Dec 5, 2015

Copy link
Copy Markdown
Member

Works for me
On Dec 4, 2015 8:47 PM, "Rod Vagg" notifications@github.com wrote:

I believe this should be semver-major like the other changes to error
messages. Tagging it as such will ensure it won't slip in to v5.x (like it
just did while I was working through the list).

Please speak up if you disagree or if you think I'm reading this wrong.


Reply to this email directly or view it on GitHub
#3878 (comment).

@JungMinu

JungMinu commented Dec 5, 2015

Copy link
Copy Markdown
Member Author

@rvagg Sounds good to me :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-major PRs that contain breaking changes and should be released in the next major version. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants