summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-realpath.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2015-06-09 11:40:55 -0700
committerRich Trott <rtrott@gmail.com>2015-06-13 22:27:17 -0700
commit7c79490bfbfee3868c1524207fcd11e0149b9c73 (patch)
tree2b93b80b6921c0f81d36efcd51c2524d875c6669 /test/parallel/test-fs-realpath.js
parent88d7904c0ba66bd2ced87f674d3f6ee098db970c (diff)
downloadandroid-node-v8-7c79490bfbfee3868c1524207fcd11e0149b9c73.tar.gz
android-node-v8-7c79490bfbfee3868c1524207fcd11e0149b9c73.tar.bz2
android-node-v8-7c79490bfbfee3868c1524207fcd11e0149b9c73.zip
test: only refresh tmpDir for tests that need it
Expose `common.refreshTmpDir()` and only call it for tests that use common.tmpDir or common.PIPE. A positive side effect is the removal of a code smell where child processes were detected by the presence of `.send()`. Now each process can decide for itself if it needs to refresh tmpDir. PR-URL: https://github.com/nodejs/io.js/pull/1954 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Diffstat (limited to 'test/parallel/test-fs-realpath.js')
-rw-r--r--test/parallel/test-fs-realpath.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/test/parallel/test-fs-realpath.js b/test/parallel/test-fs-realpath.js
index f0f6d4499c..8b698fbdcf 100644
--- a/test/parallel/test-fs-realpath.js
+++ b/test/parallel/test-fs-realpath.js
@@ -8,6 +8,8 @@ var async_completed = 0, async_expected = 0, unlink = [];
var isWindows = process.platform === 'win32';
var skipSymlinks = false;
+common.refreshTmpDir();
+
var root = '/';
if (isWindows) {
// something like "C:\\"
@@ -575,9 +577,6 @@ function runTest() {
var tmpDirs = ['cycles', 'cycles/folder'];
tmpDirs.forEach(function(t) {
t = tmp(t);
- var s;
- try { s = fs.statSync(t); } catch (ex) {}
- if (s) return;
fs.mkdirSync(t, 0o700);
});
fs.writeFileSync(tmp('cycles/root.js'), "console.error('roooot!');");