summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-chmod.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-chmod.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-chmod.js')
-rw-r--r--test/parallel/test-fs-chmod.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/parallel/test-fs-chmod.js b/test/parallel/test-fs-chmod.js
index a9d694adec..5d4a8a2b9c 100644
--- a/test/parallel/test-fs-chmod.js
+++ b/test/parallel/test-fs-chmod.js
@@ -111,9 +111,7 @@ fs.open(file2, 'a', function(err, fd) {
if (fs.lchmod) {
var link = path.join(common.tmpDir, 'symbolic-link');
- try {
- fs.unlinkSync(link);
- } catch (er) {}
+ common.refreshTmpDir();
fs.symlinkSync(file2, link);
fs.lchmod(link, mode_async, function(err) {