diff options
author | Gar <gar+gh@danger.computer> | 2022-04-13 18:43:23 +0300 |
---|---|---|
committer | Nathan Fritz <fritzy@github.com> | 2022-04-14 00:36:24 +0300 |
commit | 0cd852f62e1453e647a2551e98c78ce7e0c8ea03 (patch) | |
tree | 1c81c0e800e4f52835227980944dddfc6e6962b8 /test | |
parent | 71ab00ac3021e147c3fac19268f8e22bd163e529 (diff) |
fix: mitigate doctor test race condition
cacache appears to not write everything to the cache by the time doctor
is checking permissions. This limits the permissions error to a single
directory that we know exists by the time the checks run.
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/commands/doctor.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/lib/commands/doctor.js b/test/lib/commands/doctor.js index 620d908d3..eaf2ee6c6 100644 --- a/test/lib/commands/doctor.js +++ b/test/lib/commands/doctor.js @@ -359,8 +359,10 @@ t.test('incorrect owner', async t => { ...fs, lstat: (p, cb) => { const stat = fs.lstatSync(p) - stat.uid += 1 - stat.gid += 1 + if (p.endsWith('_cacache')) { + stat.uid += 1 + stat.gid += 1 + } return cb(null, stat) }, }, |