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

Being more permissive to files changing under insta #380

Closed
max-sixty opened this issue Jun 9, 2023 · 0 comments · Fixed by #484
Closed

Being more permissive to files changing under insta #380

max-sixty opened this issue Jun 9, 2023 · 0 comments · Fixed by #484

Comments

@max-sixty
Copy link
Sponsor Contributor

I'm often getting an error: error: No such file or directory (os error 2) which exits the process.

I get this when reviewing snapshots, and occasionally when just running cargo insta test --accept.

When reviewing a snapshot, I think it's because a pending snapshot has been removed by another process. I had a look for where in the code it was doing the file reading, but actually couldn't find it after 10 minutes and thought posting an issue was reasonable — if you can point me in the right direction I could change this to print an warning but then continue — if there's no longer a pending snapshot then skipping its review seems very reasonable?

I'm not sure why it happens when running cargo insta test --accept. Any ideas?

max-sixty added a commit to max-sixty/insta that referenced this issue Mar 3, 2024
I tracked down mitsuhiko#380 at last.

This doesn't solve the problem, but does show which file is being deleted, so it's not such a mystery. A future PR could change how these are handled so it's more permissive.

For example:

```
error: File error for `/Users/maximilian/workspace/prql/prqlc/prqlc-parser/src/.lexer.rs.pending-snap': No such file or directory (os error 2)
```
max-sixty added a commit to max-sixty/insta that referenced this issue May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant