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

ignore cache write EPERM errors on Windows #4685

Merged
merged 1 commit into from
Oct 13, 2017
Merged

Conversation

jwbay
Copy link
Contributor

@jwbay jwbay commented Oct 13, 2017

Summary

Ignore cache write EPERM errors on Windows if we're reasonably sure they came from a cross-process race condition

Test plan

Race conditions are hard to test for, but I was able to verify this patch resolved the cache write errors I was seeing on Windows as part of a Jest 21 upgrade by logging out errors caught by this check and seeing several hits (alongside passing tests).

This is ideally a temporary fix for #4444. It seems the real fix is upstream at isaacs/node-graceful-fs#119, but in the meantime, this will unblock Windows users trying to upgrade to Jest 21 or later.

if we're reasonably sure they came from a cross-process race condition
@SimenB
Copy link
Member

SimenB commented Oct 13, 2017

@jeanlauliac Thoughts on this? Is it dangerous to ignore the failure?

* On Windows, renames are not atomic, leading to EPERM exceptions when two
* processes attempt to rename to the same target file at the same time.
* If the target file exists we can be reasonably sure another process has
* legitimately won a cache write race and ignore the error.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you mention #4444 in the comment so that we'll hopefully come back later and revert this when it's not necessary?

Copy link
Contributor

@jeanlauliac jeanlauliac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's reasonnable!

@jeanlauliac
Copy link
Contributor

Tests are failing for "test-node-8" though, can you investigate and/or rebase the changeset so that we make sure it's all good? Thank you!

@cpojer
Copy link
Member

cpojer commented Oct 13, 2017

I think we can merge this, the node 8 issue was fixed separately.

@cpojer cpojer merged commit 8841bde into jestjs:master Oct 13, 2017
@jwbay jwbay deleted the wincaching branch October 20, 2017 00:27
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants