Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix root-ownership race conditions in meta-test #262

Closed

Commits on Sep 30, 2019

  1. 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.
    isaacs committed Sep 30, 2019
    Copy the full SHA
    cdfe5c1 View commit details
    Browse the repository at this point in the history