FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix missing original env variable issue on multiple test cases. by john-yan · Pull Request #3190 · nodejs/node · GitHub

/ node Public

Fix missing original env variable issue on multiple test cases. - #3190

Closed
john-yan wants to merge 1 commit into
nodejs:masterfrom
john-yan:master
Closed

Fix missing original env variable issue on multiple test cases.#3190
john-yan wants to merge 1 commit into
nodejs:masterfrom
john-yan:master

Conversation

john-yan commented Oct 5, 2015

Copy link
Copy Markdown

When the parent spawn the child processes, the environment variables passing into the child processes are missing the original env variables passing into the parent. Some missing variables like LD_LIBRARY_PATH cause the child processes unable to run.

PR-URL: #3183

rvagg commented Oct 5, 2015

Copy link
Copy Markdown
Member

copied my comments from #3191

lgtm

I imagine the proper way to do this is with Object.assign() but since it's tests I'm not sure it matters, anyone else have an opinion on that?

mscdex added the test Issues and PRs related to the tests. label Oct 6, 2015
mhdawson self-assigned this Oct 6, 2015

mhdawson commented Oct 6, 2015

Copy link
Copy Markdown
Member

I think @cjihrig was suggesting using this approach

env: util._extend(process.env, {NODE_DEBUG: process.argv[2]})

john-yan commented Oct 6, 2015

Copy link
Copy Markdown
Author

@rvagg @cjihrig @mhdawson Hello, I don't mind to change to Object.assign, extend or something else, because it shouldn't make any difference from the testing perspective. But which one do you agree on?

cjihrig commented Oct 6, 2015

Copy link
Copy Markdown
Contributor

I forgot we have Object.assign() now. If you can use that, that's probably the correct approach.

john-yan force-pushed the master branch 2 times, most recently from 8a16df9 to 7e8844d Compare October 6, 2015 23:52

john-yan commented Oct 6, 2015

Copy link
Copy Markdown
Author

@rvagg @cjihrig Redo commit with Object.assign()

Comment thread test/parallel/test-fs-readfile-error.js Outdated

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think you can drop the || {} now.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Fixed.

Comment thread test/sequential/test-util-debug.js Outdated

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is HOME still required? Seems like it should get copied over now.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, thanks, you are right. Home should be copied over. Fixed.

cjihrig commented Oct 7, 2015

Copy link
Copy Markdown
Contributor

LGTM

mhdawson commented Oct 7, 2015

Copy link
Copy Markdown
Member

lgtm will land tomorrow

jasnell commented Oct 8, 2015

Copy link
Copy Markdown
Member

jasnell commented Oct 8, 2015

Copy link
Copy Markdown
Member

Seeing a CI failure on freebsd (https://ci.nodejs.org/job/node-test-commit-other/854/nodes=freebsd101-64/console) that may be related to this commit.

not ok 886 test-child-process-emfile.js
#
#assert.js:89
#  throw new assert.AssertionError({
#  ^
#AssertionError: 0 undefined null
#    at emitTwo (events.js:87:13)
#    at ChildProcess.emit (events.js:172:7)
#    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

@john-yan @mhdawson ... can you please investigate before landing in master. If landed in master in time, I'll pick it back to v4.x but not sure it'll make it for v4.2.0

Copy link
Copy Markdown
Contributor

I've been seeing that test fail more often

Copy link
Copy Markdown
Member

Pretty sure that test isn't related: #3193

LinusU commented Oct 8, 2015

Copy link
Copy Markdown
Contributor

Object.assign actually modifies the first argument, should we really send process.env there?

Maybe do this instead:

- Object.assign(process.env, { foo: expected })
+ Object.assign({}, process.env, { foo: expected })

john-yan commented Oct 8, 2015

Copy link
Copy Markdown
Author

Hello @LinusU , looks like they wanted to extend process.env instead.

john-yan commented Oct 8, 2015

Copy link
Copy Markdown
Author

Hello @jasnell , Given that the changes in this commit has no global effect and no change has been made to the failing test cases in the CI, I don't think it's related.

jasnell commented Oct 8, 2015

Copy link
Copy Markdown
Member

Ok. Thank you for clarifying. Running one more local test then will land on master.

jasnell pushed a commit that referenced this pull request Oct 8, 2015
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #3190

jasnell commented Oct 8, 2015

Copy link
Copy Markdown
Member

Landed in a9d42e0

jasnell closed this Oct 8, 2015
jasnell pushed a commit that referenced this pull request Oct 8, 2015
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #3190
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

Labels

test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants


Back | FazBrowse Home | New Git URL