Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2017-05-23 00:17:36 +0300
committerRebecca Turner <me@re-becca.org>2017-05-26 04:55:29 +0300
commitad5a441288fb6b510d8c1995732e422f2604169e (patch)
treea7f76d49b5920f2e5cdb59d2c915a58c66caef98 /test
parentde3383079372c10c8316dcae764a467348e80778 (diff)
utils/link: Make less race prone
Previously it was gently-rming it's target before making a new target directory. gently-rm vacuums, removing empty directories. This was fine until you run more than one `link` command concurrently, at which point it's entirely possible for one invocation to `mkdir` the directory, then immediately have another one `gently-rm` it, at which point the symlink fails. Races!
Diffstat (limited to 'test')
-rw-r--r--test/tap/unit-link.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/tap/unit-link.js b/test/tap/unit-link.js
index e4b909406..4f4083e11 100644
--- a/test/tap/unit-link.js
+++ b/test/tap/unit-link.js
@@ -227,7 +227,7 @@ function testLink (opts, cb) {
}
}
},
- '../../lib/utils/gently-rm.js': dezalgo(function (toRemove, gently, cb) {
+ '../../lib/utils/gently-rm.js': dezalgo(function (toRemove, gently, basedir, cb) {
if (opts.rm[toRemove] && opts.rm[toRemove].gently === gently) {
cb()
} else {