Commit Graph

4 Commits

Author SHA1 Message Date
Ruben Bridgewater
195239a5f6 test: fix race condition in test-worker-process-cwd.js
This simplifies the test logic and fixes the race condition that
could happen right now.

PR-URL: https://github.com/nodejs/node/pull/28609
Refs: https://github.com/nodejs/node/issues/28193
Closes: https://github.com/nodejs/node/pull/28477
Fixes: https://github.com/nodejs/node/issues/27669
Fixes: https://github.com/nodejs/node/issues/28477
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-07-17 20:52:52 -07:00
Samantha Sample
5ccce52113 test: normalize location test-worker-process-cwd.js runs tests
This change sets the process' directory to __dirname in order to
normalize where the test is ran.  This addresses the situation that
occurs when node is located in the root, and moving up a directory
results in the same directory.  In that case, an error was thrown
because the test interpreted this as a failed directory change.

Fixes: https://github.com/nodejs/node/issues/28193
PR-URL: https://github.com/nodejs/node/pull/28271
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2019-06-20 12:54:26 -06:00
ZYSzys
dcc5e51e1c tools: force common be required before any other modules
PR-URL: https://github.com/nodejs/node/pull/27650
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-05-13 19:39:34 +08:00
Ruben Bridgewater
1d022e8253
process: improve cwd performance
This caches the current working directory and only updates the variable
if `process.chdir()` is called.

PR-URL: https://github.com/nodejs/node/pull/27224
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2019-04-26 18:43:11 +02:00