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.
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);