diff options
author | Stanislav Ochotnicky <sochotnicky@redhat.com> | 2013-04-10 15:38:02 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-04-16 17:05:51 +0200 |
commit | 47198af55a384788cda34c430531d928e24ae261 (patch) | |
tree | 229e06fed1765c4dcf2a7698ac13126c68ccc69b | |
parent | d58ee7e5c72c26b9ec81f2533d64cecd4b7959f8 (diff) | |
download | node-47198af55a384788cda34c430531d928e24ae261.tar.gz |
test: preserve process.env in forked child_process
When LD_LIBRARY_PATH is overriden for custom builds we need to preserve
it for forked process. There are possibly other environment variables
that could cause test failures so we preserve whole environment of
parent process.
-rwxr-xr-x | test/simple/test-child-process-fork-exec-path.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/simple/test-child-process-fork-exec-path.js b/test/simple/test-child-process-fork-exec-path.js index 51370d7d5..e0cf77c28 100755 --- a/test/simple/test-child-process-fork-exec-path.js +++ b/test/simple/test-child-process-fork-exec-path.js @@ -44,9 +44,12 @@ else { fs.writeFileSync(copyPath, fs.readFileSync(nodePath)); fs.chmodSync(copyPath, '0755'); + // slow but simple + var envCopy = JSON.parse(JSON.stringify(process.env)); + envCopy.FORK = 'true'; var child = require('child_process').fork(__filename, { execPath: copyPath, - env: { FORK: 'true' } + env: envCopy }); child.on('message', common.mustCall(function(recv) { assert.deepEqual(msg, recv); |