diff options
author | isaacs <i@izs.me> | 2019-09-30 20:21:10 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2019-10-08 02:25:04 +0300 |
commit | 44a2b036b34324ec85943908264b2e36de5a9435 (patch) | |
tree | 15e719501072ca71ee3fda7c35103ce238596f7f /node_modules/node-gyp | |
parent | dcff367a742257b00a21ad870ef370e4ecbd2f5d (diff) |
fix root-ownership race conditions in meta-test
Currently all of our tests verify on teardown that there are no
root-owned files in the cache.
However, owing to some race conditions and slippery stream event
deferral behavior that won't be fixed until v7, occasionally cacache's
chown doesn't get processed until _after_ the promise resolves and the
test ends.
As a result, sometimes this check occurs before the chown has happened,
resulting in flaky hard-to-reproduce failures.
The somewhat-kludgey solution here is to move the ownership check from
t.teardown to process.on('exit'). In npm v7, we should move it back to
t.teardown, because we should never have a test that resolves in such a
way as to leave the cache in an invalid state.
PR-URL: https://github.com/npm/cli/pull/262
Credit: @isaacs
Close: #262
Reviewed-by: @isaacs
Diffstat (limited to 'node_modules/node-gyp')
0 files changed, 0 insertions, 0 deletions