Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1522562

Browse filesBrowse files
rvaggMylesBorins
authored andcommitted
test: pass process.env to child processes
For variables such as LD_LIBRARY_PATH and DYLD_LIBRARY_PATH that are needed for dynamically linked binaries PR-URL: #16405 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent d721c0b commit 1522562
Copy full SHA for 1522562

File tree

Expand file treeCollapse file tree

4 files changed

+7
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+7
-9
lines changed
Open diff view settings
Collapse file

‎benchmark/_http-benchmarkers.js‎

Copy file name to clipboardExpand all lines: benchmark/_http-benchmarkers.js
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,9 @@ class TestDoubleBenchmarker {
9191
create(options) {
9292
const child = child_process.fork(this.executable, {
9393
silent: true,
94-
env: {
95-
duration: options.duration,
96-
connections: options.connections,
97-
path: `http://127.0.0.1:${options.port}${options.path}`
98-
}
94+
env: Object.assign({}, process.env, {
95+
test_url: `http://127.0.0.1:${options.port}${options.path}`
96+
})
9997
});
10098
return child;
10199
}
Collapse file

‎benchmark/_test-double-benchmarker.js‎

Copy file name to clipboardExpand all lines: benchmark/_test-double-benchmarker.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
const http = require('http');
44

5-
http.get(process.env.path, function() {
5+
http.get(process.env.test_url, function() {
66
console.log(JSON.stringify({ throughput: 1 }));
77
});
Collapse file

‎test/parallel/test-child-process-fork-no-shell.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-child-process-fork-no-shell.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const expected = common.isWindows ? '%foo%' : '$foo';
88
if (process.argv[2] === undefined) {
99
const child = cp.fork(__filename, [expected], {
1010
shell: true,
11-
env: { foo: 'bar' }
11+
env: Object.assign({}, process.env, { foo: 'bar' })
1212
});
1313

1414
child.on('exit', common.mustCall((code, signal) => {
Collapse file

‎test/sequential/test-inspector-port-cluster.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-inspector-port-cluster.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,11 +311,11 @@ function workerProcessMain() {
311311
function spawnMaster({ execArgv, workers, clusterSettings = {} }) {
312312
return new Promise((resolve) => {
313313
childProcess.fork(__filename, {
314-
env: {
314+
env: Object.assign({}, process.env, {
315315
workers: JSON.stringify(workers),
316316
clusterSettings: JSON.stringify(clusterSettings),
317317
testProcess: true
318-
},
318+
}),
319319
execArgv
320320
}).on('exit', common.mustCall((code, signal) => {
321321
checkExitCode(code, signal);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.